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

Backspace does not delete selected text #637

Closed
ttmms opened this issue Aug 5, 2020 · 12 comments
Closed

Backspace does not delete selected text #637

ttmms opened this issue Aug 5, 2020 · 12 comments
Assignees
Labels
💥 Bug Something isn't working
Milestone

Comments

@ttmms
Copy link

ttmms commented Aug 5, 2020

Simple-keyboard version
2.29.72

Describe the bug
Selecting text and pressing backspace does not delete selected text

@hodgef
Copy link
Owner

hodgef commented Aug 5, 2020

Hello @tuomassa,

Thanks for reporting this, I'll have a look at it soon.

Edit: The fix will involve more extensive testing, so this might take a few days before being released.

@hodgef hodgef added the 💥 Bug Something isn't working label Aug 5, 2020
@ttmms
Copy link
Author

ttmms commented Aug 6, 2020

Thanks a lot for taking a look at it!

Another related behavior that virtual keyboard users are used to, is when you select a word for example and press any letter, it replaces selected text with that letter, without having to press backspace first

@hodgef hodgef added this to the 2.30.0 milestone Aug 7, 2020
@hodgef
Copy link
Owner

hodgef commented Aug 11, 2020

Thanks @tuomassa, I added the changes to commit 1f335f6. However, this added some issues with the modules. I'll put this task on hold for now while I fix these. When everything is ready, I'll post here and release to npm. Thanks!

@Centaurnia
Copy link

Hi @hodgef Any update on this issue?

@hodgef
Copy link
Owner

hodgef commented Aug 26, 2020

Hey @Centaurnia and @tuomassa , really sorry for the delay. There was one modules bug that was driving me nuts.

I've now released v2.30.0 to a staging dist that you can use right away:

npm install simple-keyboard@2.30.0 --save

So for now it's accessible if you specify the version when installing (as shown above). This is because I still have to update the docs and check the other modules. Once I get that done I'll publish to the "latest" tag and mark this as truly complete.

Thanks!

@Centaurnia
Copy link

No Problem. Thanks a lot for the fix 👍

@karthika06031987
Copy link

We tried this fix for backspace but it is not working as expected.
When we select and do backspace, it is not getting deleted and also getting copy pasted as shown below -

Step1: Selecting multiple characters & Pressing backspace -The backspace doesnt delete the selected text.
image

Step2: We try to click random key after the text not getting deleted. This results in copy pasting of previously selected text
image

The cursor also remain in the middle of both the text sequences resulting in displaying the newly typed characters to appear in the middle

@Centaurnia
Copy link

Hi @hodgef, We get the same issue which @karthikaanoop posted in the above comment. Can you please take a look and give some solution.

@hodgef
Copy link
Owner

hodgef commented Aug 26, 2020

Hey guys, I cannot seem to reproduce this in the following 2.30.0 sandbox (Windows 10, Chrome 84):
https://codesandbox.io/s/festive-solomon-jpwl5

Can you reproduce that issue in the above sandbox? If not there might be something weird going on. Maybe it only happens on some devices.

Note: There's one known limitation with the input selection at the moment. For instance, when you select the text your mouseup has to be within the input bounds (since we don't update caret unless event.target = an input). It's kind of a drawback but the alternative would be to save the last input element in a var which I wouldn't like to do.

Best,
Francisco Hodge

@hodgef
Copy link
Owner

hodgef commented Sep 3, 2020

Hello guys - I've gone ahead and merged selection support to master. New users that install simple-keyboard will be getting this functionality. I'll keep an eye out for any issues that might arise with caret positioning.

Thanks!
Francisco Hodge

@riccardoflp
Copy link

Hi @hodgef,
if while I select the text I leave the input it does not work correctly.
I noticed it in this example.
bug

@hodgef
Copy link
Owner

hodgef commented Jan 7, 2021

Hello @PozziCode,

Please refer to the comment above:
#637 (comment)

Note: There's one known limitation with the input selection at the moment. For instance, when you select the text your mouseup has to be within the input bounds (since we don't update caret unless event.target = an input). It's kind of a drawback but the alternative would be to save the last input element in a var which I wouldn't like to do.

As I mentioned here, I don't think this edge case warrants changing caret positioning code (which I prefer to leave as-is to prevent bigger issues). I also don't think a lot of people will select text in that manner.

If you come across other issues please feel free to create a new ticket. Thanks!

Regards,
Francisco Hodge

Repository owner locked as resolved and limited conversation to collaborators Jan 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💥 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants