Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
raimund-schluessler committed Aug 16, 2022
1 parent 38cca70 commit be3f1f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/ActionButton/ActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This component is made to be used inside of the [Actions](#Actions) component sl
</template>
Delete and close
</ActionButton>
<ActionButton :close-after-click="true" @click="focusInput()">
<ActionButton :close-after-click="true" @click="focusInput">
<template #icon>
<Plus :size="20" />
</template>
Expand Down
34 changes: 17 additions & 17 deletions src/components/Popover/Popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,33 +152,33 @@ export default {
/**
* Add focus trap for accessibility.
*/
useFocusTrap() {
this.$nextTick(() => {
if (!this.focusTrap) {
return
}
async useFocusTrap() {
await this.$nextTick()
const el = this.$refs.popover?.$refs.popperContent?.$el
if (!this.focusTrap) {
return
}
if (!el) {
return
}
const el = this.$refs.popover?.$refs.popperContent?.$el
if (!el) {
return
}
this.$focusTrap = createFocusTrap(el, {
// Prevents to lose focus using esc key
// Focus will be release when popover be hide
escapeDeactivates: false,
allowOutsideClick: true,
})
this.$focusTrap.activate()
this.$focusTrap = createFocusTrap(el, {
// Prevents to lose focus using esc key
// Focus will be release when popover be hide
escapeDeactivates: false,
allowOutsideClick: true,
})
this.$focusTrap.activate()
},
/**
* Remove focus trap
*
* @param {object} options The configuration options for focusTrap
*/
async clearFocusTrap(options = {}) {
clearFocusTrap(options = {}) {
try {
this.$focusTrap?.deactivate(options)
this.$focusTrap = null
Expand Down

0 comments on commit be3f1f7

Please sign in to comment.