mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-10 05:35:05 +08:00
This overrides the default CodeMirror input logic to put more text in the textarea. CodeMirror uses an offscreen <textarea> to detect input. Due to inconsistencies in the many browsers it supports, it simplifies things by regularly checking if something is in the <textarea>, adding those characters to the document, and then clearing the <textarea>. This breaks assistive technology that wants to read from CodeMirror, because the <textarea> that they interact with is constantly empty. Because we target up-to-date Chrome, we can guarantee consistent input events. This lets us leave the current line from the editor in our <textarea>. CodeMirror still expects a mostly empty <textarea>, so we pass CodeMirror a fake <textarea> that only contains the user's input. Change-Id: I025a1937bfd66fa574fd692da079a5888d9cb529 Reviewed-on: https://chromium-review.googlesource.com/1020193 Commit-Queue: Joel Einbinder <einbinder@chromium.org> Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#564347} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: d06dd5982b810b4c3576388ef3a31f060685dff7