You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| disabled | ✔️ | `boolean` | Flag that disables the input element |
97
+
| maxLength | ✔️ | `number` | Indicates the maximum number of characters a user can enter |
98
+
| autoFocus | ✔️ | `boolean` | Flag to automatically focus the input element on mount |
99
+
| tagName | ✔️ | `string` | HTML tag for the editable element (default: `"div"`) |
100
+
| multiLine | ✔️ | `boolean` | Allow multi-line input (default: `true`). Set to `false` for single-line |
101
+
| sanitize | ✔️ | `(content:string) =>string` | Callback to sanitize content before `onChange` fires |
102
+
| updatedContent | ✔️ | `string` | Text injected from parent element into the input as the current value |
103
+
| onContentExternalUpdate | ✔️ | `(content) =>void` | Method that emits the injected content by the `updatedContent` prop |
104
+
| onChange | ✔️ | `(content, meta?) =>void` | Emits current content and optional `{ caretPosition }` metadata |
105
+
| onKeyUp | ✔️ | `(e) =>void` | Method that emits the keyUp keyboard event |
106
+
| onKeyDown | ✔️ | `(e) =>void` | Method that emits the keyDown keyboard event |
107
+
| onFocus | ✔️ | `(e) =>void` | Method that emits the focus event |
108
+
| onBlur | ✔️ | `(e) =>void` | Method that emits the blur event |
109
+
| onPaste | ✔️ | `(e) =>void` | Method that emits the paste event |
110
+
111
+
The component also accepts any standard HTML attribute (`id`, `data-*`, `tabIndex`, `spellCheck`, `style`, `className`, etc.) which will be forwarded to the editable element.
112
+
113
+
### Types
114
+
115
+
The package exports the following TypeScript types:
116
+
117
+
```typescript
118
+
import type { ContentEditableHandle, ContentEditableProps } from "react-basic-contenteditable"
0 commit comments