Skip to content

Conversation

@metonym
Copy link
Collaborator

@metonym metonym commented Dec 3, 2025

Fixes #2404

Fixes a regression caused by #2359 where ToolbarContent was incorrectly made inert when rows were selected in a DataTable, even when no ToolbarBatchActions component was present. This prevented users from interacting with toolbar controls, such as search inputs and buttons, when rows were selected.

Previously, ToolbarContent checked for selected row IDs from the DataTable context to determine if it should be inert. However, this caused issues when a DataTable had row selection enabled but no batch actions component. The fix tracks the actual visibility state of batch actions through a new batchActionsActive store in the Toolbar context, ensuring toolbar content is only inert when batch actions are actually visible.

Example of affected usage:

<DataTable {headers} {rows} bind:selectedRowIds>
  <Toolbar>
    <ToolbarContent>
      <ToolbarSearch persistent />
      <Button>Action</Button>
    </ToolbarContent>
  </Toolbar>
</DataTable>

Changes

  • Add batchActionsActive writable store to Toolbar context to track batch actions visibility state
  • Update ToolbarBatchActions to set batchActionsActive based on whether batch actions are shown
  • Update ToolbarContent to subscribe to batchActionsActive instead of checking batchSelectedIds from DataTable context

Fixes #2404

Track batch actions visibility state instead of selection state to
prevent toolbar content from being inert when rows are selected
without the batch actions component present.
@metonym metonym force-pushed the toolbar-inert-regression branch from 2e7e6bf to d4351f6 Compare December 3, 2025 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ToolbarContent disabled since v0.93 when

1 participant