Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

<select> in PWA doesn't fire on Android #609

Open
erbarratt opened this issue May 4, 2022 · 0 comments
Open

<select> in PWA doesn't fire on Android #609

erbarratt opened this issue May 4, 2022 · 0 comments

Comments

@erbarratt
Copy link

Select that fire correctly in Chrome on Android, don't fire when in the PWA of that same site.

FastClick is the only plugin, everything else is vanilla JS.

It only doesn't fire on select's that ALSO have an eventListener attached to them (usually change) OR that are checked inside the the eventListener of another element.

For example, I have a "Country" select with option val=0 being "Please Select". The submit button for that form checks to see if that select's val is still 0, and if so marks it with some CSS. Inside a PWA, this select box doesn't open.

If I duplicate the same form but remove the click eventListener on the submit button, the select DOES fire.

This is all bypassed by "needsclick" class, but I found it interesting there was this distinction.

Now, for every page before calling FastClick, I run:

let selects = document.querySelectorAll('select');
for(let i = 0; i < selects.length; i++){
	selects[i].classList.add('needsclick');
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant