Skip to content

Conversation

SuperlinDuck
Copy link

@SuperlinDuck SuperlinDuck commented Mar 12, 2022

Hi there,

I found a problem on IText and tried to fix it.

When the user selects a word and presses down key, the cursor does not move to the right position, unlike <textarea>.

if it is not the last line, the cursor will move down and close to the right side. But this is not a problem, maybe it's designed to be like this.
case_1
In the same case, <textarea> will move the cursor to the left.
textarea_1

When the same case happen in the last line, the cursor will not move to the end of text, and the right key doesn’t work after that.
case_2

It is not difficult to fix this problem, and I change the test unit of this case.

Hope I can help 🦆

@SuperlinDuck SuperlinDuck changed the title fix(IText): behaviour of move cursor down after select word fix(IText): behaviour of moving cursor down after select word Mar 12, 2022
@ShaMan123
Copy link
Contributor

Good timing, we are working on IText :)

@ShaMan123
Copy link
Contributor

You should checkout the #7674 branch and see if what you experience happens after applying the fix

@SuperlinDuck
Copy link
Author

You should checkout the #7674 branch and see if what you experience happens after applying the fix

Hi, This branch does not solve the situation I meet.

I just realize that the problem happen when an emoji 🦆 appears in the text, and I added a test of this case.

You can try it on the home page of fabricjs.com.

@asturur
Copy link
Member

asturur commented Mar 21, 2022

hi @Superlin-supreme and thanks for your first pr, complete of unit tests.
I have been out a couple of weeks.

I ll look at this branch asap.
That textarea behaviour you pointed out, is it consistent across browsers?
What google docs does?

This is mostly what i look at when i judge the behavour.

@asturur asturur self-assigned this Mar 21, 2022
@SuperlinDuck
Copy link
Author

SuperlinDuck commented Mar 23, 2022

Hi @asturur,
I tried this behavour of textarea in Chrome and Firefox, and found it to be inconsistent across browsers.
So, how do think about this behabour.
Of course, I would like to revert the change of src/mixins/itext_key_behavior.mixin.js, cause it will change the feature of this.
And keep the change of src/mixins/itext_behavior.mixin.js to fix the case happen in the last line.

@ShaMan123 ShaMan123 added the text label Mar 28, 2022
@SuperlinDuck
Copy link
Author

Hi @asturur, I tried this behavour of textarea in Chrome and Firefox, and found it to be inconsistent across browsers. So, how do think about this behabour. Of course, I would like to revert the change of src/mixins/itext_key_behavior.mixin.js, cause it will change the feature of this. And keep the change of src/mixins/itext_behavior.mixin.js to fix the case happen in the last line.

I revert the change of behavior when move cursor down.

@stale
Copy link

stale bot commented Sep 21, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Sep 21, 2022
@ShaMan123 ShaMan123 removed the stale Issue marked as stale by the stale bot label Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants