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

feat(theme): use inert to avoid traverse menus and content with keyboard #2329

Closed
wants to merge 3 commits into from

Conversation

userquin
Copy link
Member

@userquin userquin commented May 1, 2023

This PR includes inert attribute to prevent traverse content and menu on narrow sreens:

  • moved isScreenOpen outside the composable
  • included logic in Layout to deal with inert attribute, right now the attribute is not being handled by vue, if present handled as present (vue is rendering the attribute as inert="false")

This PR fixes #1332 (closed by #1491, but not working in current version, check video)

https://streamable.com/tf9qtu

inert attribute supported by all major browsers: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert#browser_compatibility

TODO: remove undefined when vuejs/core#8209 merged

@@ -36,27 +39,27 @@ provide('hero-image-slot-exists', heroImageSlotExists)
<template>
<div v-if="frontmatter.layout !== false" class="Layout">
<slot name="layout-top" />
Copy link
Member Author

@userquin userquin May 1, 2023

Choose a reason for hiding this comment

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

should we wrap layout-top and layout-bottom slots for inert?

Copy link
Member Author

@userquin userquin May 2, 2023

Choose a reason for hiding this comment

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

should we also provide some inert-* in the Layout?

@brc-dd brc-dd force-pushed the main branch 2 times, most recently from 7ad4a4e to f0d3082 Compare August 3, 2023 10:20
@brc-dd brc-dd closed this Sep 10, 2023
@userquin userquin deleted the userquin/feat-use-inert branch September 10, 2023 14:36
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

menu (navigation drawer) should not be traversable with keyboard when not shown
2 participants