pglejzer / timepicker-ui

timepicker-ui is an easy library with timepicker. Fully wrote with TypeScript. This library is based on Material Design from Google.
MIT License
62 stars 18 forks source link

Switching mobile and desktop in 24h mode doesn't auto-reopen the clock #9

Closed Polm90 closed 2 years ago

Polm90 commented 2 years ago

If you set the timepicker in 24h mode, when you try to switch to mobile and viceversa, the picker doesn't reopen itself. An error is written in console:

Cannot read properties of null (reading 'dataset'),

I saw that "this.activeTypeMode" is null.

When you are not using the 24h mode, the picker reopens itself but the following error is fired in console: e.map is not a function

RedskyThirty commented 2 years ago

+1 Same for me

RedskyThirty commented 2 years ago

private get activeTypeMode() { return document.querySelector('.timepicker-ui-type-mode.active') as HTMLButtonElement; }

The element with class "timepicker-ui-type-mode" doesn't exist in "24h" mode.

const beforeTypeModeContent = this.activeTypeMode.dataset.type; => index.ts / Line 1088

pglejzer commented 2 years ago

It's fixed in 2.3.0 version.