Skip to content

Conversation

@matyasf
Copy link
Collaborator

@matyasf matyasf commented Nov 20, 2025

Increase epsilon tolerance from 0.05 to 1 pixel to avoid false positives when detecting scrollbars due to browser rounding errors. This prevents unnecessary tabIndex=0 from being applied when no scrollbar is present.

Fixes INSTUI-4863

To test:
Set checkbox sizes with this code:

<Modal open={true} label="Modal">
  <Modal.Header> 
    <Heading>Modal</Heading>
  </Modal.Header>
  <Modal.Body>
    <Checkbox label="Modal" size="small" /> 
  </Modal.Body>
</Modal>

There should be no scrollbar

🤖 Generated with Claude Code

Increase epsilon tolerance from 0.05 to 1 pixel to avoid false positives
when detecting scrollbars due to browser rounding errors. This prevents
unnecessary tabIndex=0 from being applied when no scrollbar is present.

Fixes INSTUI-4863

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@matyasf matyasf self-assigned this Nov 20, 2025
@github-actions
Copy link

github-actions bot commented Nov 20, 2025

PR Preview Action v1.6.3
Preview removed because the pull request was closed.
2025-11-25 09:38 UTC

@matyasf matyasf requested a review from HerrTopi November 24, 2025 09:49
@ToMESSKa
Copy link
Contributor

@matyasf Test plan says "There should be no scrollbar", but there is no scrollbar in the latest version with that code either. Shouldn't we check for the modal body not getting focused instead? I think the fix is about that.

@matyasf
Copy link
Collaborator Author

matyasf commented Nov 25, 2025

@matyasf Test plan says "There should be no scrollbar", but there is no scrollbar in the latest version with that code either. Shouldn't we check for the modal body not getting focused instead? I think the fix is about that.

The issue is that there is no test whether the scrollbar is shown, the best thing is what we do -- compare scroll height and bounding box height

@matyasf matyasf merged commit 5ae1f42 into master Nov 25, 2025
10 of 11 checks passed
@matyasf matyasf deleted the fix_modal_focus branch November 25, 2025 09:37
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

Successfully merging this pull request may close these issues.

5 participants