sveltestrap
sveltestrap copied to clipboard
Support `keyboard` option of Offcanvas
The current implementation of Offcanvas does not allow you to opt out of the keyboard control (aka, pressing ESC closes the offcanvas).
It is called keyboard
within the Bootstrap Offcanvas options.
It seems the functionality would be pretty simple to add—I can contribute the changes if I find a moment.
Work Effort
- Add
export let keyboard = true;
toOffcanvas.svelte
- Update
Offcanvas.d.ts
to have thekeyboard: boolean
prop. - Update
Offcanvas.svelte
to only add thebodyEvent
event listener ifkeyboard
istrue
.