Skip to content

Remove TextNode.selectEnd#330

Merged
trueadm merged 1 commit into
mainfrom
remove-select-end
May 18, 2021
Merged

Remove TextNode.selectEnd#330
trueadm merged 1 commit into
mainfrom
remove-select-end

Conversation

@zurfyx

@zurfyx zurfyx commented May 18, 2021

Copy link
Copy Markdown
Member

It works the same way as select() so it's redundant.

For reference, select:

if (typeof text === 'string') {
      const lastOffset = text.length;
      if (anchorOffset === undefined) {
        anchorOffset = lastOffset;
      }
      if (focusOffset === undefined) {
        focusOffset = lastOffset;
      }
    } else {
      anchorOffset = 0;
      focusOffset = 0;
    }

Added an extra test for select to ensure that select(undefined, undefined) works just like the previous selectEnd()

@zurfyx zurfyx requested a review from trueadm May 18, 2021 08:12
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 18, 2021
@trueadm trueadm merged commit 25861c6 into main May 18, 2021
@trueadm trueadm deleted the remove-select-end branch May 18, 2021 09:42
acywatson pushed a commit that referenced this pull request Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants