Skip to content

Commit

Permalink
Fixed #3760 Fixed #2348 - Inplace: FocusTrap support
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Mar 17, 2023
1 parent dda3d44 commit 6d4e489
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/inplace/Inplace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Inplace.vue', () => {
},
slots: {
display: `{{'Click to Edit'}}`,
content: `<InputText autoFocus />`
content: `<InputText autofocus />`
}
});

Expand Down Expand Up @@ -90,7 +90,7 @@ describe('Inplace.vue', () => {
},
slots: {
display: `{{'Click to Edit'}}`,
content: `<InputText autoFocus />`
content: `<InputText autofocus />`
}
});

Expand Down
6 changes: 5 additions & 1 deletion components/inplace/Inplace.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :class="containerClass" aria-live="polite">
<div v-focustrap :class="containerClass" aria-live="polite">
<div v-if="!d_active" ref="display" :class="displayClass" :tabindex="$attrs.tabindex || '0'" role="button" @click="open" @keydown.enter="open" v-bind="displayProps">
<slot name="display"></slot>
</div>
Expand All @@ -12,6 +12,7 @@

<script>
import Button from 'primevue/button';
import FocusTrap from 'primevue/focustrap';
export default {
name: 'Inplace',
Expand Down Expand Up @@ -84,6 +85,9 @@ export default {
},
components: {
IPButton: Button
},
directives: {
focustrap: FocusTrap
}
};
</script>
Expand Down

0 comments on commit 6d4e489

Please sign in to comment.