what-input
what-input copied to clipboard
Possible bug: value persists "mouse" after pressed a key on a checkbox or a radio.
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")));`
data-whatintent
becomes "keyboard"
after pressed "Enter" button on IOS. Is this expected behaviour?
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?
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.
@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.