The initial value of the Editable in both edit & preview mode
Editable
EditableText is used for inline renaming of some text. It appears as normal UI text but transforms into a text input field when the user clicks or focuses on it.
Props#
Editable Props#
defaultValue
defaultValuestringfinalFocusRef
finalFocusRefThe ref of element to receive focus when the modal closes.
RefObject<FocusableElement>isDisabled
isDisabledIf true, the Editable will be disabled.
booleanisPreviewFocusable
isPreviewFocusableIf true, the read only view, has a tabIndex set to 0
so it can receive focus via the keyboard or click.
booleantrueonBlur
onBlurCallback invoked when the user either submits or cancels. It provides the last confirmed value as argument.
(nextValue: string) => voidonCancel
onCancelCallback invoked when user cancels input with the Esc key.
It provides the last confirmed value as argument.
(previousValue: string) => voidonChange
onChangeCallback invoked when user changes input.
(nextValue: string) => voidonEdit
onEditCallback invoked once the user enters edit mode.
() => voidonSubmit
onSubmitCallback invoked when user confirms value with enter key or by blurring input.
(nextValue: string) => voidplaceholder
placeholderThe placeholder text when the value is empty.
stringselectAllOnFocus
selectAllOnFocusIf true, the input's text will be highlighted on focus.
booleantruestartWithEditView
startWithEditViewIf true, the Editable will start with edit mode by default.
booleansubmitOnBlur
submitOnBlurIf true, it'll update the value onBlur and turn off the edit mode.
booleantruevalue
valueThe value of the Editable in both edit & preview mode
stringProps#
Editable Props#
defaultValue
defaultValueThe initial value of the Editable in both edit & preview mode
stringfinalFocusRef
finalFocusRefThe ref of element to receive focus when the modal closes.
RefObject<FocusableElement>isDisabled
isDisabledIf true, the Editable will be disabled.
booleanisPreviewFocusable
isPreviewFocusableIf true, the read only view, has a tabIndex set to 0
so it can receive focus via the keyboard or click.
booleantrueonBlur
onBlurCallback invoked when the user either submits or cancels. It provides the last confirmed value as argument.
(nextValue: string) => voidonCancel
onCancelCallback invoked when user cancels input with the Esc key.
It provides the last confirmed value as argument.
(previousValue: string) => voidonChange
onChangeCallback invoked when user changes input.
(nextValue: string) => voidonEdit
onEditCallback invoked once the user enters edit mode.
() => voidonSubmit
onSubmitCallback invoked when user confirms value with enter key or by blurring input.
(nextValue: string) => voidplaceholder
placeholderThe placeholder text when the value is empty.
stringselectAllOnFocus
selectAllOnFocusIf true, the input's text will be highlighted on focus.
booleantruestartWithEditView
startWithEditViewIf true, the Editable will start with edit mode by default.
booleansubmitOnBlur
submitOnBlurIf true, it'll update the value onBlur and turn off the edit mode.
booleantruevalue
valueThe value of the Editable in both edit & preview mode
string