Skip to content

Commit

Permalink
TextEditingDelta Support for the Web (#28527)
Browse files Browse the repository at this point in the history
* Initial implementation of TextEditingDeltaState for the web

* Capture composing region through compositionupdate and handle cases where there is an edit that occurs before the current cursor position

* clean up unused code

* clean up rest of logs

* Make sure we initialize oldText in beforeInput

* Clean up comments

* more defaults

* Add more comments

* Move delta inferrence logic to TextEditingDeltaState

* Add new listeners to rest of strategies

* Fix existing tests

* Fix tests

* Add lastTextEditingDeltaState to test

* fix tests

* Add some preliminary tests for TextEditingDeltaState

* Send as list to framework

* Add composing region test

* Address nits

* Update tests

* Try to fix tests

* Prefer const with constant constructors

* Clean up comments

* Specify types

* fix tests

* Specify type annotations

* batchDeltas -> deltas

* Make eventData nullable so we dont compare with a 'null' string

* Make TextEditingDeltaState mutable to avoid multiple copies

* Fix analyzer

* Fix test

* Use safe browser api instead of directly accessing js_util

* remove last prefix from editingDeltaState

* Remove logs

* fix merge

* fix whitespace

* revert composing changes

* update comments

* remove trailing whitespace

* Add docs for TextEditingDeltaState

* Normalize delta naming and use a copy instead of modifying function arguments

* Update selection of delta in inferDeltaState instead of onChange

* Fix tests, previously the selection was not set in inferDeltaState, now it
is so the tests should reflect this change

* Make a copy of delta instead of modifying function arguments

* remove whitespace

* Move some logic into inferDeltaState

* whitespace

* analyzer fix

* Revert "analyzer fix"

This reverts commit 786a528.

* Revert "whitespace"

This reverts commit 98fad47.

* Revert "Move some logic into inferDeltaState"

This reverts commit a600e9e.

* pass _editingDeltaState instead of editingDeltaState to onChange for clarity

* Add docs for beforeinput

* Add docs for inferDeltaState

* whitespace

* Add more docs

* update docs

* update docs

* Fix for insertion of a period following a double space within old text bounds

* Fix accent insertion

* clean up comments

* Address comments for clarity aand regexp

* Make composing and selection nullable

* update docs

* whitespace

* address comments

Co-authored-by: Renzo Olivares <roliv@google.com>
  • Loading branch information
Renzo-Olivares and Renzo Olivares authored Feb 10, 2022
1 parent f55b161 commit d36d25f
Show file tree
Hide file tree
Showing 3 changed files with 462 additions and 14 deletions.
Loading

0 comments on commit d36d25f

Please sign in to comment.