Focus last element when exiting modal
This commit is contained in:
parent
9e7bd91f88
commit
6550940625
|
@ -77,10 +77,12 @@ const type = $computed(() => {
|
||||||
|
|
||||||
let contentClicking = false;
|
let contentClicking = false;
|
||||||
|
|
||||||
|
const focusedElement = document.activeElement;
|
||||||
const close = () => {
|
const close = () => {
|
||||||
if (props.src) props.src.style.pointerEvents = 'auto';
|
if (props.src) props.src.style.pointerEvents = 'auto';
|
||||||
showing = false;
|
showing = false;
|
||||||
emit('close');
|
emit('close');
|
||||||
|
focusedElement.focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
const onBgClick = () => {
|
const onBgClick = () => {
|
||||||
|
|
Loading…
Reference in New Issue