fix(dropdown): clearable icon is not clickable on mobile #1220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofclick
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 listTestcase
Current behavior
Clearable icon does not work
https://jsfiddle.net/tnk79L1q/show
Fixed
Clearable works now
https://jsfiddle.net/tnk79L1q/1/show
Screenshot
Closes
#647