Bug: Page scroll on clicking a RadioButton in a long RadioButtonGroup #2016
Labels
1 - assigned
Issues that are assigned to a sprint and a team member.
bug
Bug reports for broken functionality. Issues should include a reproduction of the bug.
good first issue
Issues that can be worked on by contributors new to calcite-components.
Milestone
Summary
When you have a RadioButtonGroup that is longer than the screen height, clicking on a CalciteRadioButton scrolls the page to the top.
I've isolated the cause to https://github.com/Esri/calcite-components/blob/master/src/components/calcite-radio-button/calcite-radio-button.tsx#L263.
this.focused = true
causes afocus()
call for the underlying input element and the page scrolls.Actual Behavior
Page scrolls to the top
Expected Behavior
Page should maintain its position
Reproduction Steps
Created a simplified reproduction case on CodeSandbox
live app: https://j12l8.csb.app/
codesandbox link: https://codesandbox.io/s/cold-worker-j12l8?file=/src/index.js
Scroll down and click on a radio button that is "below the fold" and you see the page scroll to the top.
Relevant Info
Tested on Chrome, Safari, and Firefox. Seeing same behavior across browsers and platforms.
The text was updated successfully, but these errors were encountered: