{"action":"created","issue":{"url":"https://api.github.com/repos/ianstormtaylor/slate/issues/3206","repository_url":"https://api.github.com/repos/ianstormtaylor/slate","labels_url":"https://api.github.com/repos/ianstormtaylor/slate/issues/3206/labels{/name}","comments_url":"https://api.github.com/repos/ianstormtaylor/slate/issues/3206/comments","events_url":"https://api.github.com/repos/ianstormtaylor/slate/issues/3206/events","html_url":"https://github.com/ianstormtaylor/slate/pull/3206","id":531944565,"node_id":"MDExOlB1bGxSZXF1ZXN0MzQ4Mjk3NTY3","number":3206,"title":"Simplified mentions example with dropdown (#3152)","user":{"login":"timothyarmes","id":1092550,"node_id":"MDQ6VXNlcjEwOTI1NTA=","avatar_url":"https://avatars1.githubusercontent.com/u/1092550?v=4","gravatar_id":"","url":"https://api.github.com/users/timothyarmes","html_url":"https://github.com/timothyarmes","followers_url":"https://api.github.com/users/timothyarmes/followers","following_url":"https://api.github.com/users/timothyarmes/following{/other_user}","gists_url":"https://api.github.com/users/timothyarmes/gists{/gist_id}","starred_url":"https://api.github.com/users/timothyarmes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothyarmes/subscriptions","organizations_url":"https://api.github.com/users/timothyarmes/orgs","repos_url":"https://api.github.com/users/timothyarmes/repos","events_url":"https://api.github.com/users/timothyarmes/events{/privacy}","received_events_url":"https://api.github.com/users/timothyarmes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-12-03T12:18:10Z","updated_at":"2019-12-03T19:37:25Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ianstormtaylor/slate/pulls/3206","html_url":"https://github.com/ianstormtaylor/slate/pull/3206","diff_url":"https://github.com/ianstormtaylor/slate/pull/3206.diff","patch_url":"https://github.com/ianstormtaylor/slate/pull/3206.patch"},"body":"_improvement_\r\n\r\n#### What's the new behavior?\r\n\r\nAn improved mentions example showing:\r\n\r\n* How to react to the current input (to detect the trigger)\r\n* How to pin a pulldown menu to a dom element (in this case the trigger)\r\n* How to override the keyboard arrow keys when the dropdown is open\r\n\r\nOf other interest:\r\n\r\n* The Slate component simply has to include` <MentionsPortal />` and call `handleSuggestionsKeys` on the `onKeyDown` event.\r\n* `MentionsPortal` is a specific usecase for responding to _mention_ triggers. Another portal could for example, respond to emoticons.  It uses a generic hook (`useSuggestions`) to parse out the current trigger search value and to fetch the dropdown positional information, and displays the results using `SuggestionsList`."},"comment":{"url":"https://api.github.com/repos/ianstormtaylor/slate/issues/comments/561323304","html_url":"https://github.com/ianstormtaylor/slate/pull/3206#issuecomment-561323304","issue_url":"https://api.github.com/repos/ianstormtaylor/slate/issues/3206","id":561323304,"node_id":"MDEyOklzc3VlQ29tbWVudDU2MTMyMzMwNA==","user":{"login":"ianstormtaylor","id":311752,"node_id":"MDQ6VXNlcjMxMTc1Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/311752?v=4","gravatar_id":"","url":"https://api.github.com/users/ianstormtaylor","html_url":"https://github.com/ianstormtaylor","followers_url":"https://api.github.com/users/ianstormtaylor/followers","following_url":"https://api.github.com/users/ianstormtaylor/following{/other_user}","gists_url":"https://api.github.com/users/ianstormtaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/ianstormtaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianstormtaylor/subscriptions","organizations_url":"https://api.github.com/users/ianstormtaylor/orgs","repos_url":"https://api.github.com/users/ianstormtaylor/repos","events_url":"https://api.github.com/users/ianstormtaylor/events{/privacy}","received_events_url":"https://api.github.com/users/ianstormtaylor/received_events","type":"User","site_admin":false},"created_at":"2019-12-03T19:37:25Z","updated_at":"2019-12-03T19:37:25Z","author_association":"OWNER","body":"Hey @timothyarmes thank you for this, it's awesome! \r\n\r\nI like how you implemented the portal, I've just opened https://github.com/ianstormtaylor/slate/pull/3214 that borrows your implementation but cleans it up a bit with some of the `Editor.*` helpers that can be used, and simplifies the rendering/styling a bit to make it easier to follow hopefully. I really appreciate you taking the time to showcase this!"}}
{"actor":{"display_login":"ianstormtaylor"}}