Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add selection variables to web implementation #208

Merged
merged 14 commits into from
Mar 7, 2024

Conversation

Skalakid
Copy link
Collaborator

@Skalakid Skalakid commented Mar 1, 2024

Details

This PR:

  • adds selection prop support on web
  • fixes selectionStart and selectionEnd variables behavior inside MarkdownTextInput ref on web
  • fixes selection detection on web

Related Issues

GH_LINK

Manual Tests

  1. Start writing in MarkdownTextInput on web
  2. Verify if cursor position is correct when writing casually
  3. Verify if text replacement works properly. Select some text and start writing
  4. Verify if after pasting text or emojis cursor is being set in correct position
  5. Add onSelectionChange handler to MarkdownTextInput and verify if event returns correct selection start value
  6. Add ref to MarkdownTextInput and verify if ref.selectionStart and ref.selectionEnd returns correct selection end value

Linked PRs

@Skalakid Skalakid force-pushed the @Skalakid/add-selection-prop branch from d82147b to 0ee944c Compare March 1, 2024 14:37
example/src/App.tsx Show resolved Hide resolved
src/MarkdownTextInput.web.tsx Outdated Show resolved Hide resolved
example/src/App.tsx Outdated Show resolved Hide resolved
src/web/cursorUtils.ts Outdated Show resolved Hide resolved
src/web/cursorUtils.ts Outdated Show resolved Hide resolved
src/web/cursorUtils.ts Outdated Show resolved Hide resolved
example/src/App.tsx Outdated Show resolved Hide resolved
src/web/cursorUtils.ts Outdated Show resolved Hide resolved
src/web/cursorUtils.ts Outdated Show resolved Hide resolved
src/MarkdownTextInput.web.tsx Show resolved Hide resolved
src/MarkdownTextInput.web.tsx Outdated Show resolved Hide resolved
src/MarkdownTextInput.web.tsx Outdated Show resolved Hide resolved
src/MarkdownTextInput.web.tsx Outdated Show resolved Hide resolved
src/MarkdownTextInput.web.tsx Outdated Show resolved Hide resolved
src/web/cursorUtils.ts Outdated Show resolved Hide resolved
@Skalakid Skalakid marked this pull request as draft March 6, 2024 09:37
@Skalakid Skalakid force-pushed the @Skalakid/add-selection-prop branch from 21e3cde to 365b441 Compare March 6, 2024 10:36
@Skalakid Skalakid force-pushed the @Skalakid/add-selection-prop branch from 365b441 to cfce5ac Compare March 6, 2024 11:46
@Skalakid Skalakid marked this pull request as ready for review March 6, 2024 12:12
@Skalakid Skalakid requested a review from tomekzaw March 6, 2024 12:12
BartoszGrajdek
BartoszGrajdek previously approved these changes Mar 6, 2024
tomekzaw
tomekzaw previously approved these changes Mar 6, 2024
Copy link
Collaborator

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@Skalakid Skalakid dismissed stale reviews from tomekzaw and BartoszGrajdek via f6889a8 March 7, 2024 08:59
@Skalakid Skalakid merged commit e214feb into main Mar 7, 2024
2 checks passed
@Skalakid Skalakid deleted the @Skalakid/add-selection-prop branch March 7, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants