Skip to content
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

fix(b-dropdown): handle issue with touch devices on MacOS using Safari/Firefox (Fixes #4328, #4344) #4329

Merged
merged 42 commits into from Nov 8, 2019

Conversation

tmorehouse
Copy link
Member

@tmorehouse tmorehouse commented Oct 31, 2019

Describe the PR

Fixes #4328
Fixes #4344

PR checklist

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Enhancement
  • ARIA accessibility
  • Documentation update
  • Other (please describe)

Does this PR introduce a breaking change? (check one)

  • No
  • Yes (please describe)

The PR fulfills these requirements:

  • It's submitted to the dev branch, not the master branch
  • When resolving a specific issue, it's referenced in the PR's title (i.e. [...] (fixes #xxx[,#xxx]), where "xxx" is the issue number)
  • It should address only one issue or feature. If adding multiple features or fixing a bug and adding a new feature, break them into separate PRs if at all possible.
  • The title should follow the Conventional Commits naming convention (i.e. fix(alert): not alerting during SSR render, docs(badge): update pill examples, fix typos, chore: fix typo in README, etc). This is very important, as the CHANGELOG is generated from these messages.

If new features/enhancement/fixes are added or changed:

  • Includes documentation updates (including updating the component's package.json for slot and event changes)
  • Includes any needed TypeScript declaration file updates
  • New/updated tests are included and passing (if required)
  • Existing test suites are passing
  • The changes have not impacted the functionality of other components or directives
  • ARIA Accessibility has been taken into consideration (Does it affect screen reader users or keyboard only users? Clickable items should be in the tab index, etc.)

If adding a new feature, or changing the functionality of an existing feature, the PR's
description above includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

@codecov
Copy link

@codecov codecov bot commented Oct 31, 2019

Codecov Report

Merging #4329 into dev will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #4329      +/-   ##
==========================================
+ Coverage   99.91%   99.91%   +<.01%     
==========================================
  Files         238      238              
  Lines        4585     4592       +7     
  Branches     1286     1287       +1     
==========================================
+ Hits         4581     4588       +7     
  Misses          3        3              
  Partials        1        1
Impacted Files Coverage Δ
src/mixins/focus-in.js 100% <100%> (ø) ⬆️
src/mixins/click-out.js 100% <100%> (ø) ⬆️
src/mixins/dropdown.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f419cb4...1580cd5. Read the comment docs.

@tmorehouse tmorehouse added PR: Patch Status: WIP Type: Fix labels Oct 31, 2019
@tmorehouse
Copy link
Member Author

@tmorehouse tmorehouse commented Oct 31, 2019

Awaiting on feedback from issue #4328

@jacobmllr95
Copy link
Member

@jacobmllr95 jacobmllr95 commented Oct 31, 2019

@tmorehouse Tested it in Safari on iOS and it doesn't solve the issue. Will look into it soon.

@tmorehouse
Copy link
Member Author

@tmorehouse tmorehouse commented Oct 31, 2019

@jackmu95 I wonder if this s a timing thing (or order of events) issue... maybe related to the click outside handler closing the menu, and then the subsequent button click re-opening the menu (i.e. clickout happens first, then button click happens after)

@tmorehouse
Copy link
Member Author

@tmorehouse tmorehouse commented Oct 31, 2019

Hmmm I just checked, and the clickout (focusout) handler tests for focus moving to the toggler (and ignores it)... so I don't think it is a race condition between the toggle handler and the focusOut handler.

@jacobmllr95 jacobmllr95 marked this pull request as ready for review Nov 1, 2019
@jacobmllr95
Copy link
Member

@jacobmllr95 jacobmllr95 commented Nov 1, 2019

The problem was that we listened for the focusout event of the menu to close it when the element gaining focus wasn't the toggle, the menu or an element inside it.
The detection of the element gaining focus was based on the relatedTarget given by the focusout event. Safari and some other browsers don't implement that properly and return null instead.

I've moved the close detection back to a document-wide click-out and focusin listeners.

@achen116 Can you confirm that the new deploy preview works for you?

@tmorehouse
Copy link
Member Author

@tmorehouse tmorehouse commented Nov 1, 2019

@jackmu95 still need to wait for the deploy-preview to build... for some reason it didn't get triggered

@tmorehouse
Copy link
Member Author

@tmorehouse tmorehouse commented Nov 1, 2019

@achen116, can you try out the deploy preview again now? https://deploy-preview-4329--bootstrap-vue.netlify.com/

@jacobmllr95 jacobmllr95 closed this Nov 1, 2019
@jacobmllr95 jacobmllr95 reopened this Nov 3, 2019
@tmorehouse

This comment has been minimized.

@tmorehouse tmorehouse changed the title fix(b-dropdown): handle issue with touch devices on MacOS using Safari/Firefox fix(b-dropdown): handle issue with touch devices on MacOS using Safari/Firefox (Fixes #4328, #4344) Nov 4, 2019
@tmorehouse tmorehouse added this to In progress in 2.1.0 via automation Nov 5, 2019
@jacobmllr95 jacobmllr95 self-requested a review Nov 8, 2019
@tmorehouse tmorehouse merged commit 2779a0a into dev Nov 8, 2019
9 checks passed
2.1.0 automation moved this from In progress to Done Nov 8, 2019
@tmorehouse tmorehouse deleted the issue/4328 branch Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Patch Type: Fix
Projects
No open projects
2.1.0
  
Done
3 participants