calcite-design-system icon indicating copy to clipboard operation
calcite-design-system copied to clipboard

Calcite-input can lose focus when next to slider in certain scenario

Open zaramatheson opened this issue 2 years ago • 3 comments

Actual Behavior

To reproduce: Go to highlight the input value, drag the mouse outside of the input box and release the mouse select button and you see the slider get highlighted and input box loses focus

HoldnRelease

Expected Behavior

The focus should remain on the input.

Reproduction Sample

Map Viewer Sketch Pane

https://codepen.io/jcfranco/pen/wvmxJvG?editors=1010

Reproduction Steps

To reproduce: Go to highlight the input value, drag the mouse outside of the input box and release the mouse select button and you see the slider get highlighted and input box loses focus

Reproduction Version

latest

Relevant Info

No response

Regression?

No response

zaramatheson avatar Aug 02 '22 21:08 zaramatheson

It looks like this issue is missing some information:

Issues without reproduction samples may not be prioritized. If you were unable to create a sample, please try to answer any questions that arise once development begins. Thanks for your understanding.

github-actions[bot] avatar Aug 02 '22 21:08 github-actions[bot]

I believe this is a wrapping-component issue and not specific to Calcite. I should know because I created it. 😂 In any case, I'll dig into it and will close this one my hunch is correct.

jcfranco avatar Aug 02 '22 21:08 jcfranco

Quick update: After digging into this, I think it's best if we update label to not assume there will only be one labelable. For comparison, browsers only focus on the first labelable and ignore the rest.

jcfranco avatar Aug 09 '22 22:08 jcfranco

This issue will be prioritized after the 1.0 release next month.

geospatialem avatar Dec 02 '22 17:12 geospatialem

I noticed the same issue in ArcGIS Charts app. It's similar to this issue. When I try to click on calcite-input element, the focus shifts to nearby calcite-slider element. Both of these elements are inside calcite-label element. Here is the code-pen used for the issue repro - https://codepen.io/apahadi73/pen/JjaELpW.

Apahadi73 avatar Feb 28 '23 18:02 Apahadi73

See findings from https://github.com/Esri/calcite-components/issues/7085#issuecomment-1572890663

driskull avatar Jun 30 '23 21:06 driskull

Installed and assigned for verification.

github-actions[bot] avatar Aug 22 '23 16:08 github-actions[bot]

Verified in 1.7.0-next.9.

geospatialem avatar Aug 27 '23 03:08 geospatialem

Mhh, I can still reproduce it using the codepen with 1.7.0 and 1.9.2.

Click on the input box and hold the mouse button then move the mouse over the slider line and release the mouse button. Now the slider button is in focus.

AdelheidF avatar Oct 12 '23 21:10 AdelheidF

Mhh, I can still reproduce it using the codepen with 1.7.0 and 1.9.2.

Click on the input box and hold the mouse button then move the mouse over the slider line and release the mouse button. Now the slider button is in focus.

@AdelheidF Thanks for getting this back on our radar!

The fix above was aimed to mitigate having the first element gain, or steal, focus from other wrapped elements. Since focus is handled within Calcite we've opened #8038 to investigate if a more advanced solution can be applied across browsers. Closing out the above issue, which was mitigated, in favor of the #8038 follow-up issue.

cc: @jcfranco

geospatialem avatar Oct 23 '23 17:10 geospatialem