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(dropdown): clearable icon is not clickable on mobile #1220

Merged
merged 2 commits into from
Dec 22, 2019

Conversation

lubber-de
Copy link
Member

Description

On mobile devices a clearable icon was not working. The mobile browsers do not seem to fetch/interpret the existing "click" event as a "touchstart" event.
I centralized the eventbinding and whenever a touchdevice is recognized it (in most cases) used touchstart instead of click not, which makes the clearable icon work now :)

Hint for review

I had to leave one click event as it is to prevent a item selection on mobile when you try to scroll the menu list

Testcase

  • Open in a mobile device, especially iOS

Current behavior

Clearable icon does not work
https://jsfiddle.net/tnk79L1q/show

Fixed

Clearable works now
https://jsfiddle.net/tnk79L1q/1/show

Screenshot

ios_clearable

Closes

#647

@lubber-de lubber-de added type/bug Any issue which is a bug or PR which fixes a bug lang/javascript Anything involving JavaScript state/awaiting-reviews Pull requests which are waiting for reviews labels Dec 13, 2019
@lubber-de lubber-de added this to the 2.8.3 milestone Dec 13, 2019
@lubber-de lubber-de requested a review from exoego December 18, 2019 10:37
Copy link
Contributor

@exoego exoego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@y0hami y0hami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@y0hami y0hami changed the title [Dropdown] Clearable Icon was not clickable on mobile fix(dropdown): clearable icon is not clickable on mobile Dec 22, 2019
@y0hami y0hami merged commit cc63475 into fomantic:develop Dec 22, 2019
@lubber-de lubber-de deleted the fix/647/mobile_clear_touch branch December 22, 2019 15:49
@lubber-de lubber-de removed the state/awaiting-reviews Pull requests which are waiting for reviews label Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants