Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

since update to v0.7.4 - error: "cannot set properties of null (setting 'onclick')" #117

Open
PeterKawa opened this issue Nov 16, 2023 · 4 comments

Comments

@PeterKawa
Copy link

PeterKawa commented Nov 16, 2023

Hi,

Since version v0.7.4 I get this error in lovelace cards where i use flex-table-card in combination with auto-entities card:
cannot set properties of null (setting 'onclick')
When I install v0.7.3 again there's no error whatsoever.

YAML of one such card:

type: custom:auto-entities
filter:
  include:
    - entity_id: switch.*
      state: 'on'
  exclude:
    - entity_id: switch.*kaar*
    - entity_id: switch.*kers*
    - entity_id: switch.*lant*
    - entity_id: switch.rol*
    - entity_id: switch.*led*
    - entity_id: switch.*lamp*
    - entity_id: switch.*cloud*
    - entity_id: sensor.*state*
    - entity_id: curtain.8
card:
  type: custom:flex-table-card
  max_rows: 35
  strict: true
  clickable: true
  title: (flex-table + auto-entities)
  css:
    table+: 'border: 20;'
  columns:
    - name: ''
      data: name
      icon: mdi:lightbulb-alert-outline
      suffix: ''
      align: center
    - name: ''
      data: state
      icon: mdi:lightbulb-on-10
      align: right
    - name: Last update
      data: last_updated
      suffix: ' hrs'
      fmt: hours_passed
    - name: Last update
      data: last_updated
      suffix: ' min'
      modify: Math.round(((Date.now() - Date.parse(x)) / 36000.) * 0.6 )
sort:
  method: friendly_name
  reverse: false
  numeric: false
  ignore_case: true

Screenshot of error:
image

When editing the card, it shows no error at the bottom, but the preview on the right only shows an alert:
image

Thanks in advance,
Peter

@EdLeckert
Copy link
Contributor

The workaround is to put a space between the quotes in the name field: ' ' vs ''. See #115.

The fix is in place in the latest version of flex-table-card.js in the repo, so alternatively you could grab that if you like, especially if you want to use any HTML in the name field. It has not been packaged into a release yet for some reason, but hopefully will be soon.

@kbrown01
Copy link

kbrown01 commented Nov 17, 2023

I assume this means that the fix will repair this (as any HTML in the name breaks the card).

- name: <div title="Games Played">GP</div>

I posted this in the HA here

Link to issue

@EdLeckert
Copy link
Contributor

@kbrown01: Yes, it is related to the column sorting feature and is fixed in the master branch. You can grab it from there if you need it quickly.

@daringer: Any chance of a new release to get this hotfix #116 out?

@daringer
Copy link
Collaborator

jup jup, thanks for fixing that, will try to test & release today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants