Describe the bug
When we set closeOnPressEscape = false we expect modal not to be closed by escape key. It works like this in dev mode, but doesn't work after build!
<IModal :closeOnPressEscape="false" ... >...</IModal>
Problem, as I see it is in packages/inkline/src/controllers/OverlayController.ts: at onPressEscape() we check topOverlay.closeOnPressEscape, while this is ref in fact -> always true.
onPressEscape() {
const topOverlay = OverlayController.getTopOverlay();
if (topOverlay && topOverlay.closeOnPressEscape) { // <- always true!
topOverlay.hide();
}
}
In packages/inkline/src/components/IModal/IModal.vue we pass ref to closeOnPressEscape:
const closeOnPressEscape = toRef(props, 'closeOnPressEscape');
...
onMounted(() => {
OverlayController.register({
name,
elementRef: wrapperRef,
closeOnPressEscape, // <- it's ref
hide
});
});
So, onPressEscape should be fixed or to ... && topOverlay.closeOnPressEscape.value or with unref (like in open()).
PS: don't know why it fails only after build and works in dev mode.
To Reproduce
Steps to reproduce the behavior:
- Create new app as described at documentation (Vite case for example)
- Add button, modal,
visible flag as described at IModal doc page
- Set
:closeOnPressEscape="false" for modal
- Execute
npm run dev: you see, it works ok and doesn't close at escape
- Execute
npm run build, npm run preview - now it closes modal by escape inspite of closeOnPressEscape = false
Expected behavior
In both cases it shouldn't close modal by escape key
Screenshots


Environment
- Version: =4.7.1
- Framework: [Vite]
- OS: [Windows]
- Browser: [Chrome 126]
- Language: [all]
Additional context
Add any other context about the problem here.
Describe the bug
When we set
closeOnPressEscape = falsewe expect modal not to be closed by escape key. It works like this in dev mode, but doesn't work after build!Problem, as I see it is in
packages/inkline/src/controllers/OverlayController.ts: atonPressEscape()we checktopOverlay.closeOnPressEscape, while this is ref in fact -> always true.In
packages/inkline/src/components/IModal/IModal.vuewe pass ref tocloseOnPressEscape:So,
onPressEscapeshould be fixed or to... && topOverlay.closeOnPressEscape.valueor with unref (like inopen()).PS: don't know why it fails only after build and works in dev mode.
To Reproduce
Steps to reproduce the behavior:
visibleflag as described at IModal doc page:closeOnPressEscape="false"for modalnpm run dev: you see, it works ok and doesn't close at escapenpm run build,npm run preview- now it closes modal by escape inspite ofcloseOnPressEscape = falseExpected behavior
In both cases it shouldn't close modal by escape key
Screenshots


Environment
Additional context
Add any other context about the problem here.