mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Fixed #5055 - Calendar: When use with Datatable filter, the calendar would show at the bottom of the page.
This commit is contained in:
parent
ae81a90b73
commit
e3d9f41926
3 changed files with 11 additions and 4 deletions
|
@ -8,7 +8,7 @@ const FocusTrap = BaseFocusTrap.extend('focustrap', {
|
|||
if (!disabled) {
|
||||
this.createHiddenFocusableElements(el, binding);
|
||||
this.bind(el, binding);
|
||||
this.autoFocus(el, binding);
|
||||
this.autoElementFocus(el, binding);
|
||||
}
|
||||
|
||||
el.setAttribute('data-pd-focustrap', true);
|
||||
|
@ -64,7 +64,10 @@ const FocusTrap = BaseFocusTrap.extend('focustrap', {
|
|||
el.$_pfocustrap_focusinlistener && el.removeEventListener('focusin', el.$_pfocustrap_focusinlistener) && (el.$_pfocustrap_focusinlistener = null);
|
||||
el.$_pfocustrap_focusoutlistener && el.removeEventListener('focusout', el.$_pfocustrap_focusoutlistener) && (el.$_pfocustrap_focusoutlistener = null);
|
||||
},
|
||||
autoFocus(el, binding) {
|
||||
autoFocus(options) {
|
||||
this.autoElementFocus(this.$el, { value: { ...options, autoFocus: true } });
|
||||
},
|
||||
autoElementFocus(el, binding) {
|
||||
const { autoFocusSelector = '', firstFocusableSelector = '', autoFocus = false } = binding.value || {};
|
||||
let focusableElement = DomHandler.getFirstFocusableElement(el, `[autofocus]${this.getComputedSelector(autoFocusSelector)}`);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue