Interface: UseLinkPopoverResult
Returned by useLinkPopover(): the controller state as fields, plus actions and prop getters.
Extends
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
error | readonly | string | null | Validation message, or null. | LinkPopoverState.error |
href | readonly | string | Current value of the address field. | LinkPopoverState.href |
isEditing | readonly | boolean | Whether the cursor or selection is inside an existing link. | LinkPopoverState.isEditing |
open | readonly | boolean | The form is open. | LinkPopoverState.open |
Methods
close()
ts
close(options?): void;Close without applying. Focuses the editor unless focusEditor is false.
Parameters
| Parameter | Type |
|---|---|
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
getFormProps()
ts
getFormProps(): ReactProps;Props for the form: role="group", aria-label. Submit applies the address.
Returns
getInputProps()
ts
getInputProps(): ReactProps;Props for the address input: aria-label, value, aria-invalid on error. Escape closes.
Returns
getRemoveProps()
ts
getRemoveProps(): ReactProps;Props for the Remove button; hidden unless the selection is in a link.
Returns
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
openPopover()
ts
openPopover(): void;Open the form, filled with the current link's address or https://, and focus the field.
Returns
void