Skip to content

Conversation

@griest024
Copy link
Member

@griest024 griest024 commented Nov 5, 2025

PR Checklist

  • Commit message follows our contributing guidelines
  • Tests added/updated (for bug fixes/features)
  • Documentation added/updated (for bug fixes/features)

PR Type

  • Bug fix
  • Feature
  • Style update
  • Refactor
  • Test
  • Build
  • CI
  • Docs
  • Performance
  • Other (please describe)

Current behavior

Fixes: #1955
Part of: #

New behavior

Breaking change?

  • Yes
  • No

Additional context

@griest024 griest024 requested a review from xelaint November 5, 2025 22:12
@griest024
Copy link
Member Author

@xelaint I need you to test out the behavior and see if you need any changes. For example, arrow keys on the outermost elements doesn't move focus, only inside a group, seems like we might always want arrow keys to move focus around.

@xelaint xelaint added package: design @daffodil/design status: wip This PR is WIP. It should be marked as a draft. labels Nov 6, 2025
@xelaint
Copy link
Member

xelaint commented Nov 6, 2025

@xelaint I need you to test out the behavior and see if you need any changes. For example, arrow keys on the outermost elements doesn't move focus, only inside a group, seems like we might always want arrow keys to move focus around.

@griest024 Are you saying the arrow key should be able to move focus from I get tabbed to first to I get tabbed to second

@griest024
Copy link
Member Author

@xelaint I need you to test out the behavior and see if you need any changes. For example, arrow keys on the outermost elements doesn't move focus, only inside a group, seems like we might always want arrow keys to move focus around.

@griest024 Are you saying the arrow key should be able to move focus from I get tabbed to first to I get tabbed to second

yes

@xelaint
Copy link
Member

xelaint commented Nov 6, 2025

@xelaint I need you to test out the behavior and see if you need any changes. For example, arrow keys on the outermost elements doesn't move focus, only inside a group, seems like we might always want arrow keys to move focus around.

@griest024 Are you saying the arrow key should be able to move focus from I get tabbed to first to I get tabbed to second

yes

I don't think so. Native behavior for moving around main interactive elements on a page without extra features is typically with tabs. e.g. moving from button to button

Copy link
Member

@xelaint xelaint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabbing from this group <div rti rtiBoundary="group"> should move focus to the next focusable element on the page, in this case it's the HTML tab, but tab cycles focus back to <div rti>I get tabbed to first</div>

@damienwebdev
Copy link
Member

So, this appears to have a few issues, once tabbed into a area with an RTI field, you're no longer able to tab to anything else labelled with RTI.

Additionally, if there are not RTI labelled elements (think button, a etc), inside the RTI, they aren't tabbable when I think they should be.

@griest024
Copy link
Member Author

So, this appears to have a few issues, once tabbed into a area with an RTI field, you're no longer able to tab to anything else labelled with RTI.

I thought this is what we wanted, tab moves focus outside of the group, arrow keys moves focus inside the group

Additionally, if there are not RTI labelled elements (think button, a etc), inside the RTI, they aren't tabbable when I think they should be.

So we should retain browser native behavior of tabbing then?

@damienwebdev
Copy link
Member

image

@griest024
Copy link
Member Author

  • tabbing should not escape group
  • as and buttons need to be implicitly included in tabbing order
  • do not intercept keyboard events, modify tabindex to control tabbing

@griest024
Copy link
Member Author

@damienwebdev I've made the requested changes, the implementation is fairly clean as well!

@griest024
Copy link
Member Author

focus trap inside rti boundary

@griest024 griest024 requested a review from xelaint December 31, 2025 01:34
@griest024
Copy link
Member Author

focus trap inside rti boundary

implemented

@xelaint
Copy link
Member

xelaint commented Jan 8, 2026

lgtm! can be moved to core

@griest024 griest024 marked this pull request as ready for review January 9, 2026 18:32
@griest024 griest024 requested review from a team as code owners January 9, 2026 18:32
@griest024 griest024 added status: pending review This PR is awaiting review or response from a reviewer before the author can proceed. and removed status: wip This PR is WIP. It should be marked as a draft. labels Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: design @daffodil/design status: pending review This PR is awaiting review or response from a reviewer before the author can proceed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RovingTabIndex

3 participants