Show:

The ButtonEditLink class provides functionality for creating and editing a link in a document. Provides UI for creating, editing and removing a link.

Methods

_focusLinkInput

() protected

Focuses the user cursor on the widget's input.

_handleKeyDown

(
  • event
)
protected

Monitors key interaction inside the input element to respond to the keys:

  • Enter: Creates/updates the link.
  • Escape: Discards the changes.

Parameters:

  • event SyntheticEvent

    The keyboard event.

_handleLinkChange

(
  • event
)
protected

Updates the component state when the link input changes on user interaction.

Parameters:

  • event SyntheticEvent

    The change event.

componentDidMount

()

Lifecycle. Invoked once, only on the client, immediately after the initial rendering occurs.

Focuses on the link input to immediately allow editing.

getInitialState

()

Lifecycle. Invoked once before the component is mounted. The return value will be used as the initial value of this.state.

render

() Object

Lifecycle. Renders the UI of the button.

Returns:

Object:

The content which should be rendered.

Properties

key

String static

The name which will be used as an alias of the button in the configuration.

Default: linkEdit