Skip to content

Column management: 'Reset to default' only resets the columns visibility, but not the order #867

@nicolethoen

Description

@nicolethoen

The Reset to default action within the Column Management Modal only reverts column visibility states. It currently fails to revert the column sequence (order) to the initial/default configuration.

Current Behavior

  • User opens the Column Management Modal.
  • User reorders columns (e.g., moves "Severity" to the first position).
  • User toggles visibility of several columns.
  • User clicks "Reset to default."

Result: Column visibility returns to default, but the "Severity" column remains in the first position instead of its original slot.

Expected Behavior

  • Clicking "Reset to default" should restore the component to its initial state, including:
  • Visibility: Default hidden/shown status.
  • Ordering: The original index sequence of the columns.

To future proof this feature, let's also expose a new prop (e.g., onReset) to the Column Management Modal.
This custom callback function for the "Reset" action allows a consumer to trigger side effects in the app (e.g., clearing local storage, resetting external filters, or updating state in a parent table component) when a user resets their column preferences.

The text of the Reset to default button also needs to be customizable so it can be translated or updated.

Proposed API

<ColumnManagementModal 
  columns={myColumns}
  // New Prop
  onReset={() => {
    console.log("Custom reset logic triggered");
    handleExternalStateReset();
  }}
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions