v0.137.0
Minor Changes
-
#1158
8088e59cThanks @tenphi! - InlineInput: new top-level component for inline-editable text, plus internal refactor ofTabsto use it.InlineInputis a reusable inline-editing primitive. It inherits typography/color from its parent so it drops into headings, paragraphs, tab titles, table cells, etc. without style customization. Value andisEditingcan each be controlled or uncontrolled.- Activation modes via
editTrigger:'dblclick'(default),'click', or'none'(programmatic only). The imperative ref exposesstartEditing(),stopEditing(submit?),focus(), andgetValue()and works regardless ofeditTrigger. - Deterministic focus flow: focus is taken via
FocusScope autoFocus restoreFocus={false}, blur is detected viauseFocusWithin(not a manualonBlur+ RAF guard). Tests / Playwright can drivedblclick → type → blurwithout waiting on frames. - Optimistic display: when controlled and the parent updates
valueasynchronously, the just-committed value is shown immediately to avoid flicker. - Async save with auto-rollback:
onSubmitmay return aPromise. On rejection the component reverts its optimistic value back to the actualvalueprop. A token guard prevents stale rejections from clobbering newer commits.
Tabsnow usesInlineInputinternally for editable tab titles (no behaviour change for consumers — F2, double-click, "rename" menu, blur-to-submit, escape-to-cancel all work as before). The internalEditableTitlecomponent and itschainRaf/ multi-RAF focus dance are gone, which removes the race conditions that previously made the editing flow hard to drive deterministically.