Add KFocusTrap and use it in KModal
🌱 Are you new to the codebase? Welcome! Please see the contributing guidelines.
Blocks
- https://github.com/learningequality/kolibri/issues/12588
Summary
This issue has two related goals
- Move focus trapping logic from Kolibri to this repository and expose it as a new
KFocusTrapcomponent - Use
KFocusTrapwithinKModalto ensure that users' focus remains contained within the modal interface, preventing accidental interactions with elements outside the modal.
Guidance
(1) Create KFocusTrap
Copy FocusTrap from Kolibri to this repository and name it as KFocusTrap. Follow the guidance for creating a new component.
(2) Wrap the content of KModal in KFocusTrap
// KModal.vue
<template>
<KFocusTrap>
<component :is="wrapper" ...>
...
(3) Check that the focus trapping works as expected
on the the playground page.
(4) Add a new documentation page for KFocusTrap
- Follow "Create a documentation page for a new component"
- Follow “Writing” guidelines. Use language that is consistent with other documentation pages.
- Describe briefly the focus trapping function
- A live example loosely similar to the ‘default behavior’ on https://focus-trap.github.io/focus-trap/ with code sample would be nice. See
DocsShowandDocsShowCodeusage on other documentation pages.
The Value Add
Improves accessibility of modals.
Acceptance criteria
- [ ] There is
KFocusTrapcomponent including a new documentation page - [ ]
KFocusTrapis used withinKModaland functions as expected - [ ] There are no regressions in
KModal
hey @MisRob can you assign this to me?
Hey @lokesh-sagi125, assigning, thank you for volunteering
hey @MisRob is there any chat server for LE like discord or is it just github?
hey @akolson @MisRob i keep getting this particular linting issue even though i added the blank lines. ,couldn't find the solution in the documentation , what should i do to fix this?.
Its most likely the line spacing before the
<template>
...
</template>
<script>
...
</script>
hey @MisRob is there any chat server for LE like discord or is it just github?
@lokesh-sagi125 Yes, we have a Slack channel for the community of contributors. You're welcome to send an e-mail to [email protected] to receive an invitation.
@MisRob Can you please assign this issue to me.
Hey @iamshobhraj! Thanks for your interest in contributing to this issue! Unfortunately, this is already assigned. But you’re welcome to find a "help wanted" issue with no assignee :).
Closed by #799