{"action":"created","issue":{"url":"https://api.github.com/repos/bootstrap-vue/bootstrap-vue/issues/675","repository_url":"https://api.github.com/repos/bootstrap-vue/bootstrap-vue","labels_url":"https://api.github.com/repos/bootstrap-vue/bootstrap-vue/issues/675/labels{/name}","comments_url":"https://api.github.com/repos/bootstrap-vue/bootstrap-vue/issues/675/comments","events_url":"https://api.github.com/repos/bootstrap-vue/bootstrap-vue/issues/675/events","html_url":"https://github.com/bootstrap-vue/bootstrap-vue/pull/675","id":241463562,"number":675,"title":"feat(dropdown): add support for hover trigger","user":{"login":"pimlie","id":1067403,"avatar_url":"https://avatars0.githubusercontent.com/u/1067403?v=3","gravatar_id":"","url":"https://api.github.com/users/pimlie","html_url":"https://github.com/pimlie","followers_url":"https://api.github.com/users/pimlie/followers","following_url":"https://api.github.com/users/pimlie/following{/other_user}","gists_url":"https://api.github.com/users/pimlie/gists{/gist_id}","starred_url":"https://api.github.com/users/pimlie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pimlie/subscriptions","organizations_url":"https://api.github.com/users/pimlie/orgs","repos_url":"https://api.github.com/users/pimlie/repos","events_url":"https://api.github.com/users/pimlie/events{/privacy}","received_events_url":"https://api.github.com/users/pimlie/received_events","type":"User","site_admin":false},"labels":[{"id":457559544,"url":"https://api.github.com/repos/bootstrap-vue/bootstrap-vue/labels/wontfix","name":"wontfix","color":"ffffff","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-07-08T16:21:36Z","updated_at":"2017-07-08T19:43:02Z","closed_at":"2017-07-08T18:49:20Z","pull_request":{"url":"https://api.github.com/repos/bootstrap-vue/bootstrap-vue/pulls/675","html_url":"https://github.com/bootstrap-vue/bootstrap-vue/pull/675","diff_url":"https://github.com/bootstrap-vue/bootstrap-vue/pull/675.diff","patch_url":"https://github.com/bootstrap-vue/bootstrap-vue/pull/675.patch"},"body":"As mentioned in my comment in #417 I would like to contradict the decision of the bootstrap team of not supporting hover events for opening dropdowns. This commit adds support for that.\r\n\r\nI have extracted the trigger logic from the `popover.js` mixin and put it in a new `triggers.js` mixin. Now if one should need to support triggers it should be as easy as importing the triggers mixin and:\r\n- setting a `triggerName` in data\r\n- add `hideComponent` and `showComponent` methods\r\n- call the triggersCreated/triggersMounted and triggersBeforeDestroy methods\r\n\r\nI have updated `dropdown` and `nav-item-dropdown` to support these new triggers. \r\nAlso I updated the tooltip component with a triggerName so its triggering `shown::tooltip` events instead of `shown::popover`.\r\n\r\nCouple of notable changes I had to implement (also good for the docs probably):\r\n- `dropdown.js` is using two trigger elements, the button and the menu. The menu is required as it is absolutely positioned thus the button is not an `offsetParent` of the menu which means events are not propagated from the menu to the button\r\n- `dropdown.js` lists a default debounce of 0. When you use a debounce value here you will probably be missing e.g. `mouseenter` events (on the menu) because you just triggered a `mouseleave` (on the button).  (the current debounce implementation I took from `popover.js` is not per event type, if we would change that that would probably be of some help)\r\n- `dropdown.js` lists a default hide delay of 150ms, this is to overcome the default margin that exists on the dropdown-menu. \r\n\r\nIf you enable both the `click` and `hover` triggers for a dropdown the menu opens on hover, and if you click stays open (`persistentState`) until you either clickout, click the menu or click the button again"},"comment":{"url":"https://api.github.com/repos/bootstrap-vue/bootstrap-vue/issues/comments/313877032","html_url":"https://github.com/bootstrap-vue/bootstrap-vue/pull/675#issuecomment-313877032","issue_url":"https://api.github.com/repos/bootstrap-vue/bootstrap-vue/issues/675","id":313877032,"user":{"login":"pimlie","id":1067403,"avatar_url":"https://avatars0.githubusercontent.com/u/1067403?v=3","gravatar_id":"","url":"https://api.github.com/users/pimlie","html_url":"https://github.com/pimlie","followers_url":"https://api.github.com/users/pimlie/followers","following_url":"https://api.github.com/users/pimlie/following{/other_user}","gists_url":"https://api.github.com/users/pimlie/gists{/gist_id}","starred_url":"https://api.github.com/users/pimlie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pimlie/subscriptions","organizations_url":"https://api.github.com/users/pimlie/orgs","repos_url":"https://api.github.com/users/pimlie/repos","events_url":"https://api.github.com/users/pimlie/events{/privacy}","received_events_url":"https://api.github.com/users/pimlie/received_events","type":"User","site_admin":false},"created_at":"2017-07-08T19:43:02Z","updated_at":"2017-07-08T19:43:02Z","body":"Although I understand your reasons, it is a bit disappointing that I asked in #417 if you (in general, not personal) would accept a PR for this and I got only one 'I don't mind' reply...\r\n\r\nThat said, the implementation in this PR _is_ completely optional and configurable. Default behaviour is still a click-only trigger and you need to explicitly add hover to the triggers to change the behaviour. Also personally I would only use the combination of the 'hover' and 'click' triggers, not just the 'hover'. Combining those two triggers negate a lot of the drawbacks you mentioned."}}
{"actor":{"display_login":"pimlie"}}