Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

fix(autocomplete): improve handling of touch pads and touchscreens #11782

Merged
merged 1 commit into from
Aug 26, 2019

Conversation

Splaktar
Copy link
Member

@Splaktar Splaktar commented Aug 24, 2019

PR Checklist

Please check that your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number:
Fixes #11778. Relates to #11625. Relates to #11757. Relates to #11758.

What is the new behavior?

  • open options pop-up on touchstart
    • since a click is often not sent on touch devices
    • this usually happens when the start/end point are not the same
  • use touchend on the document to close the options panel on iOS
    • iOS mostly does not send click events for taps on the backdrop
    • call `doBlur()`` since iOS doesn't blur in this case
  • combine some jQuery event handler calls
  • combine duplicate onMouseup() and focusInputElement() functions
  • don't let touchstart or touchend events bubble out of the component
  • focus the input for mousedown events
    • this covers an edge case on touch pads where a click isn't sent
  • move isIos and isAndroid logic out of gestures into $mdUtil
  • add and correct JSDoc
  • Disable click hijacking in docs as we recommend this to most users now.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Tested on

  • macOS: Chrome, Firefox, Safari w/ mouse and touch pad
  • Chrome OS: w/ touchscreen and touch pad
  • iOS: iPad touchscreen
  • Android: Pixel 3 touchscreen

@Splaktar Splaktar self-assigned this Aug 24, 2019
@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Aug 24, 2019
@Splaktar Splaktar added g3: reported The issue was reported by an internal or external product team. g3: sync P1: urgent Urgent issues that should be addressed in the next minor or patch release. severity: regression This issue is related to a regression type: bug type: gestures labels Aug 24, 2019
@Splaktar Splaktar added this to the 1.1.21 milestone Aug 24, 2019
@Splaktar Splaktar added the pr: merge ready This PR is ready for a caretaker to review label Aug 24, 2019
@Splaktar Splaktar added os: iOS This issue is specific to iOS os: macOS This issue is specific to macOS labels Aug 24, 2019
- open options pop-up on `touchstart`
  - since a `click` is often not sent on touch devices
  - this usually happens when the start/end point are not the same
- use `touchend` on the document to close the options panel on iOS
  - iOS mostly does not send `click` events for taps on the backdrop
  - call `doBlur()`` since iOS doesn't blur in this case
- combine some jQuery event handler calls
- combine duplicate `onMouseup()` and `focusInputElement()` functions
- don't let touchstart or touchend events bubble out of the component
- focus the input for `mousedown` events
  - this covers an edge case on touch pads where a `click` isn't sent
- move `isIos` and `isAndroid` logic out of gestures into `$mdUtil`
- add and correct JSDoc

Fixes #11778. Relates to #11625. Relates to #11757. Relates to #11758.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ g3: reported The issue was reported by an internal or external product team. os: iOS This issue is specific to iOS os: macOS This issue is specific to macOS P1: urgent Urgent issues that should be addressed in the next minor or patch release. pr: merge ready This PR is ready for a caretaker to review severity: regression This issue is related to a regression type: bug type: gestures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autocomplete: closes instantly when opened with touch
4 participants