what-input icon indicating copy to clipboard operation
what-input copied to clipboard

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

Open DmitryLen opened this issue 2 years ago • 4 comments

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 avatar Aug 09 '22 12:08 DmitryLen

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

DmitryLen avatar Aug 26 '22 09:08 DmitryLen

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?

ten1seven avatar Aug 26 '22 13:08 ten1seven

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 avatar Nov 18 '22 15:11 DmitryLen

@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.

DmitryLen avatar Nov 25 '22 08:11 DmitryLen