TarheelGrad1998 / gallery-card

A custom card for Home Assistant that will display images and/or videos from a folder in the style of a gallery.
97 stars 30 forks source link

Cannot read properties of null (reading 'focus') - Error Message #33

Closed gulli1986 closed 1 year ago

gulli1986 commented 2 years ago

Hello,

I just discovered that I get this error message in the log everytime I reload a page where the gallery page is included:

http://XX.XX.XX.XX123/hacsfiles/gallery-card/gallery-card.js?hacstag=284283867331:384:83 Uncaught TypeError: Cannot read properties of null (reading 'focus')

Any ideas what this might be? I have tried removing the lovelace card and put it back without any sucess. The error is still there everytime I refresh.

I started using this gallery card for quite a long time without getting any error message. Can this be related to the new version?

gulli1986 commented 2 years ago

I can mention that the card is still displaying the pictures as it should so I don't really know what this error refers to.

TarheelGrad1998 commented 2 years ago

Yes, the new version added focus for easier keyboard navigation.

What browser are you using?

gulli1986 commented 2 years ago

I think I found out about it. It has to do with the layout in lovelace. I was using horizontal layout and got the error message. Removing everything and using standard layout, the message is gone. Using Chrome as browser.

TarheelGrad1998 commented 2 years ago

Ah, that's a great clue, thanks! I'll try to track it down.

TarheelGrad1998 commented 1 year ago

This is fixed in v3.4.