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

Expose a method to change keyboard instance internal state before input value change #2277

Merged
merged 5 commits into from
May 20, 2024

Conversation

XcrossD
Copy link
Contributor

@XcrossD XcrossD commented May 14, 2024

Description

Hi I was developing a React app for a touchscreen device and I ran into the same touchscreen cursor problem linked here

Since it doesn't seem like they will be fixing this issue, I thought if we can't listen to the event fired, we could try to sync up the cursor location before we change the input value. All current methods are called after the fact, so I went ahead and created the method beforeInputChange with the keyboard instance passed to it.
My use case will be calling keyboard.setCaretPosition(inputRef.current.selectionStart, inputRef.current.selectionEnd). If possible I would rather not maintain a fork of this awesome library. Please let me know what you think, thanks!

Checks

npm run coverage

image

Copy link
Contributor

👋 Hello @XcrossD! Please make sure to review the Contributing Guidelines to ensure your PR is compliant. Thank you!

@hodgef
Copy link
Owner

hodgef commented May 14, 2024

Thanks for the contribution @XcrossD, I will be taking a look

Copy link
Contributor

This PR is stale because it has been open 5 days with no activity. It will be closed soon if no further activity occurs. Thank you!

@github-actions github-actions bot added the Stale Issue automatically marked as inactive label May 20, 2024
@XcrossD
Copy link
Contributor Author

XcrossD commented May 20, 2024

Bumping to stay active.

@hodgef hodgef merged commit 20b4fd5 into hodgef:master May 20, 2024
2 checks passed
@hodgef
Copy link
Owner

hodgef commented May 20, 2024

Thanks! The change is deployed:

  • simple-keyboard: 3.7.81
  • react-simple-keyboard: (auto deployment overnight, should be in by tomorrow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Issue automatically marked as inactive
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants