Double-Click to Autosize a Column
Double-clicking a column's resize handle sizes that column to fit its widest visible content, including the header label. This saves users from guessing widths through repeated dragging.
Planned. This page shows the specification from issue #185. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A grid with 500 rows whose columns hold mixed-length content. All columns start at 80px.
Expected behavior
Double-clicking a handle measures the header and rendered cells, then sets the width to the maximum measured width plus padding. The change is clamped by minWidth and maxWidth. The columnResized event fires with source='autosize'.
Planned API surface
columnDef.autosizeOnDoubleClickgridOptions.autosizeIncludeHeadergridOptions.autosizePaddingevent:columnResizedAcceptance criteria
- The resulting width equals the widest measured content plus padding, within 1px tolerance. (pending)
- The header label is included in measurement only when autosizeIncludeHeader=true. (pending)
- The result is clamped to [minWidth, maxWidth]. (pending)
- The event source is reported as 'autosize'. (pending)
- A single click on the handle does not trigger autosize. (pending)