sveltestrap icon indicating copy to clipboard operation
sveltestrap copied to clipboard

Support `keyboard` option of Offcanvas

Open RoryDuncan opened this issue 1 year ago • 0 comments

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

  1. Add export let keyboard = true; to Offcanvas.svelte
  2. Update Offcanvas.d.ts to have the keyboard: boolean prop.
  3. Update Offcanvas.svelte to only add the bodyEvent event listener if keyboard is true.

RoryDuncan avatar Jul 10 '23 18:07 RoryDuncan