Skip to content

Handle NodeLists & $refs better in dropdown.js #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 3, 2017
Merged

Handle NodeLists & $refs better in dropdown.js #327

merged 14 commits into from
May 3, 2017

Conversation

tmorehouse
Copy link
Member

Fixes #325

Plus a few tweaks on element references. In some use cases a $ref.xxx can be a component rather than a DOM element. This PR handles these cases when trying to focus the element.

Also tweaked the selectors in dropdown.js and modal.vue to ignore elements hidden by v-show="false" using the CSS3 modifier :not([style*="display: none"]):not([style*="display:none"])

* Create form-input-static.vue

New form-static input

* Added form-input-static compoinent

* Refactored static input

Refactored to use the new `<b-form-input-static>` component

* Switch to bFormInputStatic

Updated child component var to bFormInputStatic to follow proper naming conventions

* Removed lazyFormatter from static-input

* Added trailing semi-colon

To make CircleCI happy

* Added missing 'this'

* [nav-item] add dropdown class

* Added <slot> for robustness

* new b-form-input-static component (#292)

* Create form-input-static.vue

New form-static input

* Added form-input-static compoinent

* Refactored static input

Refactored to use the new `<b-form-input-static>` component

* Switch to bFormInputStatic

Updated child component var to bFormInputStatic to follow proper naming conventions

* Removed lazyFormatter from static-input

* Added trailing semi-colon

To make CircleCI happy

* Added missing 'this'

* Added <slot> for robustness

* fixed missing `.vue` extension on import

* Added missing extension on component import (#293)

* Optimized import order in form-input.vue (#294)

* Added missing extension on component import

* Optimized import order
Removed use of spread operator and switched to Array.prototype.splice.

Also modified selector to filter out dropdown items that are `v-show="false"`
Placed button focus (when called from onEsc) in $nextTick to ensure dom is rendered,.
Also handled special case when the ref is a component or plain element
In some use cases, the returnFocus element could be a reference to a component.

This fix addresses those usage cases.
Added in additional CSS selector to handle cases where a focusable element is hidden with v-show
@tmorehouse tmorehouse requested a review from pi0 May 3, 2017 02:11
@pi0 pi0 merged commit 0fcd612 into bootstrap-vue:master May 3, 2017
@tmorehouse tmorehouse deleted the tmorehouse-dropdown branch May 6, 2017 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants