lperamo / ecocomposer

Frontend library with as little JavaScript as possible.
https://ecocomposer.dev
Other
2 stars 0 forks source link

Calendar component - Crash on weekends #3

Open lperamo opened 1 year ago

lperamo commented 1 year ago

Description When the calendar component is launched, there is a bug reported by the development console as follows :

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'parentElement')
at Object.init (calendar.ts:1110:96)
at HTMLDocument._init (calendar.ts:10:26)

It happens on weekends because it tries to look for an element with the class corresponding to today's day or the days can go from Monday to Friday only.

To Reproduce Wait for the weekend or adjust temporarily the date to test it and then launch the calendar component demo page.

Expected behavior This should not crash on startup!

Desktop (please complete the following information): Tested on Ubuntu 22.04.1 LTS, Chromium "Version 109.0.5414.74 (Build officiel) snap (64 bits)"