EditContextLimited availability
The EditContext API allows you to build rich text editors that support advanced text input, such as Input Method Editor (IME) composition, an emoji picker, or other platform-specific editing UI.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1–120Not supported
121+Supportedsince Jan 23, 2024
Current: 155Edge
12–120Not supported
121+Supportedsince Jan 25, 2024
Current: 154Firefox
✕Not supportedup to 157
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–120Not supported
121+Supportedsince Jan 23, 2024
Current: 155Firefox Android
✕Not supportedup to 157
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Firefox, Safari, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: CharacterBoundsUpdateEvent.
Feature detection
JS · check before using
if ("EditContext" in globalThis) {
// EditContext is available
} else {
// load a polyfill or use a fallback
}Sub-features
Support for each part of the feature (39). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| CharacterBoundsUpdateEvent | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| CharacterBoundsUpdateEvent.CharacterBoundsUpdateEvent | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| CharacterBoundsUpdateEvent.rangeEnd | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| CharacterBoundsUpdateEvent.rangeStart | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.EditContext | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.attachedElements | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.characterBounds | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.characterBoundsRangeStart | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.characterboundsupdate_event | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.compositionend_event | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.compositionstart_event | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.selectionEnd | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.selectionStart | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.text | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.textformatupdate_event | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.textupdate_event | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.updateCharacterBounds | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.updateControlBounds | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.updateSelection | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
Show 19 more
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| EditContext.updateSelectionBounds | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| EditContext.updateText | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| HTMLElement.editContext | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextFormat | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextFormat.TextFormat | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextFormat.rangeEnd | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextFormat.rangeStart | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextFormat.underlineStyle | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextFormat.underlineThickness | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextFormatUpdateEvent | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextFormatUpdateEvent.TextFormatUpdateEvent | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextFormatUpdateEvent.getTextFormats | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextUpdateEvent | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextUpdateEvent.TextUpdateEvent | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextUpdateEvent.selectionEnd | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextUpdateEvent.selectionStart | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextUpdateEvent.text | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextUpdateEvent.updateRangeEnd | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |
| TextUpdateEvent.updateRangeStart | 121 | 121 | ✕ | ✕ | 121 | ✕ | ✕ |