Skip to content

Options don't update when lit TableController update. #5831

@Lookwe69

Description

@Lookwe69

When the options in TableController.table changes, they are not used => previous options are kept.

I look in the code. I think it because '...options' is missing when we setOptions on tableInstance.

Current code :

this.tableInstance.setOptions(prev => ({
      ...prev,
      state: { ...this._tableState, ...options.state },
      onStateChange: (updater: any) => {
        this._tableState = updater(this._tableState)
        this.host.requestUpdate()
        options.onStateChange?.(updater)
      },
    }))
`

Fix code :

`js
this.tableInstance.setOptions(prev => ({
      ...prev,
      ...options,
      state: { ...this._tableState, ...options.state },
      onStateChange: (updater: any) => {
        this._tableState = updater(this._tableState)
        this.host.requestUpdate()
        options.onStateChange?.(updater)
      },
    }))
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions