Skip to content

Interface: UseLinkPopoverResult ​

Returned by useLinkPopover(): the controller state as fields, plus actions and prop getters.

Extends ​

Properties ​

PropertyModifierTypeDescriptionInherited from
errorreadonlystring | nullValidation message, or null.LinkPopoverState.error
hrefreadonlystringCurrent value of the address field.LinkPopoverState.href
isEditingreadonlybooleanWhether the cursor or selection is inside an existing link.LinkPopoverState.isEditing
openreadonlybooleanThe form is open.LinkPopoverState.open

Methods ​

close() ​

ts
close(options?): void;

Close without applying. Focuses the editor unless focusEditor is false.

Parameters ​

ParameterType
options?{ focusEditor?: boolean; }
options.focusEditor?boolean

Returns ​

void


getErrorProps() ​

ts
getErrorProps(): ReactProps;

Props for the error message: role="alert", hidden while there is no error.

Returns ​

ReactProps


getFormProps() ​

ts
getFormProps(): ReactProps;

Props for the form: role="group", aria-label. Submit applies the address.

Returns ​

ReactProps


getInputProps() ​

ts
getInputProps(): ReactProps;

Props for the address input: aria-label, value, aria-invalid on error. Escape closes.

Returns ​

ReactProps


getRemoveProps() ​

ts
getRemoveProps(): ReactProps;

Props for the Remove button; hidden unless the selection is in a link.

Returns ​

ReactProps


getTriggerProps() ​

ts
getTriggerProps(): ReactProps;

Props for the toolbar button: id, aria-label, title with the shortcut, aria-keyshortcuts, aria-pressed (inside a link), aria-expanded, aria-controls. Click toggles the form.

Returns ​

ReactProps


openPopover() ​

ts
openPopover(): void;

Open the form, filled with the current link's address or https://, and focus the field.

Returns ​

void