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

Possible bug: value persists "mouse" after pressed a key on a checkbox or a radio. #128

Open
DmitryLen opened this issue Aug 9, 2022 · 4 comments

Comments

@DmitryLen
Copy link

DmitryLen commented Aug 9, 2022

Because const formInputs = ['button', 'input', 'select', 'textarea'] includes an input tag,
"whatintent" value persists "mouse" after pressed a key on a checkbox or a radio.

Possible solution:
`

    const notFormInput =

    activeElem &&

    activeElem.nodeName &&

    (formInputs.indexOf(activeElem.nodeName.toLowerCase()) === -1 ||

      activeElem.type === "radio"

      || activeElem.type === "checkbox"

      || (activeElem.nodeName.toLowerCase() === "button" &&

        !checkClosest(activeElem, "form")));`
@DmitryLen
Copy link
Author

DmitryLen commented Aug 26, 2022

data-whatintent becomes "keyboard" after pressed "Enter" button on IOS. Is this expected behaviour?

@ten1seven
Copy link
Owner

Hi @DmitryLen, thanks for bringing this issue up. Your first message sounds like the intended behavior when interacting with forms. I have that documented under interacting with forms. Can you take a look at that and let me know if you're seeing that or a bug? If, for your app, you want to detect all input changes, even when interacting with a form, you can use data-whatinput. data-whatintent "buffers" the input detection for mouse users when they interact with form elements.

The second issue you found, keyboard detection on iOS, seems like a bug. Did you see that in the current version of iOS so I can test?

@DmitryLen
Copy link
Author

DmitryLen commented Nov 18, 2022

I've read the interacting with forms section.
It says, the idea is mouse user's data-whatintent will be preserved as mouse while typing
@ten1seven , But checkboxes and radio share the same input tag as the text field, so "data-whatintent" value is preserved as mouse, after pressed a key on a checkbox or a radio.

The second issue you found, keyboard detection on iOS, seems like a bug. Did you see that in the current version of iOS so I can test?
@ten1seven , Sorry for no bug description. I can't reproduce this now on IOS 13 and IOS 16. This is not actual so far. May be this issue is specific HTML form markup dependent.

@DmitryLen
Copy link
Author

@ten1seven ,

IOW,
"data-whatintent" value is preserved as "mouse", when pressing a key on a checkbox or a radio, but this doesn't seem to be a "while typing" case.
This happens, because checkboxes and radio share the same input tag as the text field.

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

No branches or pull requests

2 participants