Repository navigation
Conversation
A key pressed while the mouse was still down typed at the press point, because the textarea skipped every write during a drag, and the insertion handle vanished as the phone keyboard opened. A selection taller than the view also lost its menu or put it under the editor. Only the drag's own selections now wait for its end, the page and keyboard no longer hide the handle, and the menu clamps into the view.
With 100 underlines in view, every key rebuilt the edited line's underline boxes and read a Range rect for each piece, 3.3 ms a key at 8x CPU throttling. Each underline is now a span around its text whose background draws the bar or the wave, so a key repaints only its own line, about 0.3 ms over plain typing. Selection and match boxes are read per text node, so the span's padding never grows them, and the span takes no taps.
An empty line's element held no text, so its box was 0 px tall. A click on a blank line put the caret on an earlier line (line 0 for line 1 of a file that opens with an import and a blank line), because the browser's hit test snapped to the nearest text and the fallback by row never matched a box with no height. Line elements now keep at least one row of height.
The insertion handle faded 4 s after a tap even with its Paste menu open, and a menu placed under the caret then jumped up 44 px, so a finger on its way to Paste landed on the text instead. The handle now stays while the menu is open and fades 4 s after the menu closes.
…menu When Safari's paste prompt was dismissed, the insertion handle stayed on screen for good. Its 4 s fade comes due while the menu is open and waits for the menu to close, but a menu item closed the menu without telling the editor. The menu now reports every close, so the fade starts again whatever closed it.
A long press on the gutter in Safari on iOS selected a line number and opened Safari's own Copy, Look Up, Translate menu on top of the editor's menu. Only the text layer turned off text selection and the touch callout. The gutter now does too.
On Chrome for Android, dragging a selection handle for more than half a second dropped the keyboard and hid the handles, while the selection and its menu stayed. Chrome blurs the focused field during any held touch, and only a tap or a long press focused the editor again on release. A handle drag now does too.
A tap, then a long press on a word, then an arrow key 4 s later showed an insertion handle at the new caret for another 4 s. The handle's fade skips while a menu is open, and the word's menu kept the tap's handle alive under the selection. A range selection now ends the insertion handle. The test for the handle's fade after its menu closes now closes the menu with a key instead of a blur, which hid the handles on its own.
With scrollEnabled false inside a scrolling element, as a ScrollView renders on the web, a mouse drag held below the fold scrolled nothing and scrollToLine left the line out of view: both wrote window.scrollTo, and the window does not scroll in that layout. The editor now scrolls its nearest scrolling ancestor and falls back to the window, and the drag's fold is that element's bottom edge. The edit menu also hides once its selection scrolls out of that element, where it stayed pinned to the element's top.
After Select all with the keyboard up, a tap inside the selection slid the page up 312 px on Chrome Android. The hidden textarea sat at the selection end under the keyboard, and Chrome scrolls the page to a focused field after every tap. Under avoidKeyboard the editor already keeps the caret clear of the keyboard, so the textarea now stays above it too.
The insertion handle stayed for as long as its Paste menu was open, while Android hides it 4 s after the last touch and leaves the menu where it is. It was kept because the menu's anchor counted the handle only while drawn, so a menu under the caret jumped up 44 px when it faded. The anchor now keeps room for the handles whether drawn or faded, a finger held on the handle keeps it, and lifting the finger starts its 4 s again.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes from trying the selection work on phones and desktop browsers:
scrollEnabled={false}inside a scrolling element, like a ScrollView on the web, a mouse drag held below the fold scrolled nothing andscrollToLineleft the line out of view, because both wrotewindow.scrollTo. the editor scrolls its nearest scrolling ancestor now and falls back to the window, and the menu hides once its selection scrolls out of that element.avoidKeyboard, a tap inside a selection whose end sat under the keyboard slid the page up 312 px on Chrome for Android, since Chrome scrolls the page to a focused field after every tap. the hidden textarea stays above the keyboard now.the example also gets a readOnly toggle on the web and a minified file, and the typing bench prints none for an empty list instead of throwing.
stacked on #42 (its own commits)