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 onClick-event to select all to amount input #104

Conversation

justcallmelarry
Copy link
Contributor

When you add a new expense you always have to start by removing the placeholder 0 value that is already there.

I added an onFocus event to select the entire value so that you can just start writing the amount immediately

Copy link
Contributor

@shynst shynst left a comment

Choose a reason for hiding this comment

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

Works fine with Chrome, has issues though with Safari when selecting the input field by clicking into it:

  • first the onFocus event fires, selecting the text
  • after that the onClick event fires, deselecting it again

Suggestion

Use an onClick() event handler to select the text instead.

shynst added a commit to shynst/spliit that referenced this pull request Feb 27, 2024
@justcallmelarry
Copy link
Contributor Author

Works fine with Chrome, has issues though with Safari when selecting the input field by clicking into it:

  • first the onFocus event fires, selecting the text
  • after that the onClick event fires, deselecting it again

Suggestion

Use an onClick() event handler to select the text instead.

Good catch, I had only tested in safari on mobile and there it worked as expected. I think onClick might be good.

@justcallmelarry justcallmelarry changed the title Add onfocus-event to select all to amount input Add onClick-event to select all to amount input Feb 27, 2024
@scastiel
Copy link
Member

💯

@scastiel scastiel merged commit 56c1865 into spliit-app:main Feb 28, 2024
1 check passed
@justcallmelarry justcallmelarry deleted the feature/add-onfocus-select-to-amount-input-field branch February 28, 2024 16:13
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.

None yet

3 participants