Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set visual focus indicator on the iframe #96

Merged

Conversation

kolkheang
Copy link
Member

Summary

Set visual focus indicator on the iframe when focus/blur style is given by consumers. This change would allow keyboard only users to see where the focus is on the page and navigate the page with a better user experience for accessibility.

Additional Details

By default, the auto resize logic is used to size the content appropriately. However, this library also has option to set fixedWidth and fixedHeight which may not fully display the content in the viewport. With that as the case, scrolling is needed to see the content. For a better user experience for keyboard only users, we should have a way to display the visual focus indicator on the frame so the users know that the focus is on the frame and can start using the arrow keys to scroll the content as needed.

src/provider/application.js Outdated Show resolved Hide resolved
Copy link
Contributor

@Gagerdude Gagerdude left a comment

Choose a reason for hiding this comment

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

One more question: the intention is to only add these focus styles when the iframe can't otherwise be targeted with keyboard navigation - and iframes that we can navigate or scroll using the keyboard before this change will be unaffected?

src/consumer/frame.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/consumer/frame.js Outdated Show resolved Hide resolved
src/provider/application.js Outdated Show resolved Hide resolved
src/provider/application.js Show resolved Hide resolved
src/provider/application.js Outdated Show resolved Hide resolved
@kolkheang
Copy link
Member Author

kolkheang commented Nov 8, 2023

One more question: the intention is to only add these focus styles when the iframe can't otherwise be targeted with keyboard navigation - and iframes that we can navigate or scroll using the keyboard before this change will be unaffected?

Yeah, no change visually to the existing browser's frame functionality. You can still tab through and get to the interactable element inside of the frame like before and scroll (if scrollable).

The condition that would have the tabIndex=0 set on the embedded page, and the new outline style on the frame is when:

  • the embedded page doesn't have any interactable element inside
  • the content is scrollable (has more scroll height than client height)
  • the iframe has scrolling config set to yes or auto (default)

…g previous tabIndex value so the value can be reverted
@Gagerdude Gagerdude merged commit 4ca98f6 into oracle-samples:master Nov 29, 2023
@jfrhong
Copy link

jfrhong commented Nov 29, 2023 via email

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.

4 participants