Renders the editing of a text in place, with no page or form of its own. InlineEdit shows the text and opens the field over it: a dump's title and note, a playlist's title and description, a profile's description and email. InlineEditField is that field alone, for a text that opens it with an action of its own: a comment's Edit, a chat message's ✎.

Functions

f
InlineEdit(unnamed 0: InlineEditProps): React.JSX.Element

Renders children, which a click on them, or the ✎ button after them, swaps for a field holding value, with Save and Cancel under it. The ✎ shows on hover and on keyboard focus. A click on a link in the text, or one that ends a selection, follows the link or keeps the selection instead. Closing the field gives the focus back to the ✎ when the field had it.

f
InlineEditField(unnamed 0: InlineEditFieldProps): React.JSX.Element

Renders the field holding value, focused with the caret at its end, and Save and Cancel under it. Enter saves a line, Ctrl/Cmd+Enter a Markdown text, Escape leaves. Saving is refused while the text is empty and required, or longer than maxLength. It is mounted afresh on each opening, so that it starts from value.

Interfaces

I
InlineEditFieldProps

Passed to InlineEditField by InlineEdit, and by the components that open it with an action of their own, CommentNode and ChatMessageItem, in place of the text while it is edited.

I
InlineEditProps

Passed to InlineEdit by the component showing the text, which renders it as children and saves it in onSave.