fix(date-picker): stop "Escape" from closing modal

Fixes #952
This commit is contained in:
Eric Liu 2021-12-28 14:36:10 -08:00
commit 21cad7e8d9

View file

@ -234,6 +234,12 @@
{datePickerType === 'range' && {datePickerType === 'range' &&
$labelTextEmpty && $labelTextEmpty &&
'bx--date-picker--nolabel'}" 'bx--date-picker--nolabel'}"
on:keydown="{(e) => {
if (calendar?.isOpen && e.key === 'Escape') {
e.stopPropagation();
calendar.close();
}
}}"
> >
<slot /> <slot />
</div> </div>