custom-cards / flex-table-card

Highly Flexible Lovelace Card - arbitrary contents/columns/rows, regex matched, perfect to show appdaemon created content and anything breaking out of the entity_id + attributes concept

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error "Cannot set properties of null (setting 'onclick')"

edersong opened this issue · comments

After the upgrade to v0.7.4, one of my cards are reporting the error Cannot set properties of null (setting 'onclick') even there is no onclick on his code.

image

I have the same problem if I use name: '' in my card, maybe it's the reason for this.

Example:

columns:
- data: entity_picture
align: center
name: ''
icon: mdi:gas-station
modify: '''<img src="'' + x + ''"style="height: 35px;width:100%">'''

I add a space for the name and it works (I want only an icon for my colomn)

columns:
- data: entity_picture
align: center
name: ' '
icon: mdi:gas-station
modify: '''<img src="'' + x + ''"style="height: 35px;width:100%">'''

I had HTML TITLE tags on my names to give info on a mouse over.

Once I removed those, the error went away.

The fix for this is in my repo. If you need it sooner or want to help me test it and are in a position to update flex-table-card.js manually, it is here:

https://github.com/EdLeckert/flex-table-card/tree/fix-generate-new-id-for-onclick-error

The fix for this is in my repo. If you need it sooner or want to help me test it and are in a position to update flex-table-card.js manually, it is here:

https://github.com/EdLeckert/flex-table-card/tree/fix-generate-new-id-for-onclick-error

It works for me ! Thx for this quick hotfix 😃

Did not work in my situation.

Here is the column code that is at issue:

        - name: >-
            <div title="Clinch Indicator:&#10; * : Clinched Best League
            Record&#10; z : Clinched Playoff Birth&#10; x : Clinched
            Division&#10; - : In The Hunt&#10; e : Eliminated">C</div>
          data: entries
          modify: >-
            if(typeof x.stats.find(y=>y.abbreviation == 'CLINCH') !==
            'undefined' ){x.stats.find(y=>y.abbreviation ==
            'CLINCH').displayValue}else{'-'}

If I remove the HTML, it works fine.

Let me know if you need more code for the whole card.

Thanks

@JeffCrum1: What behavior or error are you seeing?

I'm getting the character "C" with the key for "Clinch Indicator" on hover. I don't have the data to make the modify work, but the name works fine for me.

So sorry. I didn't realize I needed to delete the .gz file when manually updating.

All good now!

Thanks for your very quick response!!!

there also is a 0.7.5 release now with all the fixes included...