Skip to content

Commit

Permalink
feat: Using @vue-a11y/focus-loop to trap focus in social popup
Browse files Browse the repository at this point in the history
  • Loading branch information
ktquez committed Jul 30, 2020
1 parent bdf76b0 commit f2dbd51
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
18 changes: 5 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@
"vuepress-theme-default-vue-a11y": "^0.1.15"
},
"dependencies": {
"vue-focus-lock": "^1.4.0"
"@vue-a11y/focus-loop": "^0.1.0"
}
}
4 changes: 2 additions & 2 deletions rollup.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import vue from 'rollup-plugin-vue'
export default commandLineArgs => {
return {
input: 'src/index.js',
external: ['vue-focus-lock'],
external: ['@vue-a11y/focus-loop'],
plugins: [
commonjs(),
replace({
Expand All @@ -30,7 +30,7 @@ export default commandLineArgs => {
name: 'VueSocialChat',
exports: 'named',
globals: {
'vue-focus-lock': 'FocusLock'
'@vue-a11y/focus-loop': 'FocusLoop'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/SocialChat.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<FocusLock :disabled="!show">
<FocusLoop :disabled="!show">
<div
ref="vscPopup"
class="vsc-popup"
Expand Down Expand Up @@ -64,20 +64,20 @@
>
</button>
</div>
</FocusLock>
</FocusLoop>
</template>

<script>
import ListChat from './ListChat.vue'
import FocusLock from 'vue-focus-lock'
import { FocusLoop } from '@vue-a11y/focus-loop'
import { URL_ASSETS, HREF_BY_APP } from './constants'
export default {
name: 'VueSocialChat',
components: {
ListChat,
FocusLock
FocusLoop
},
props: {
Expand Down

0 comments on commit f2dbd51

Please sign in to comment.