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

fix(IText): some RTL selection issues #7864

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open

fix(IText): some RTL selection issues #7864

wants to merge 67 commits into from

Conversation

ShaMan123
Copy link
Contributor

@ShaMan123 ShaMan123 commented Apr 5, 2022

  • Renamed relevant left/right methods to start/end (I am quite sure I missed some, logic is quite messy). This will make things clearer.
  • Adapted the move cursor logic. It is still far from perfect but is much better.
  • Exposed method setSelectionRange to align with html standard and selectionDirection
  • deprecated _selectionDirection, didn't remove it yet. It has no affect but I want you to look at it before I remove it to see I am not missing out on anything. selectionDirection is now updated by the textarea on _updateTextarea but that might not be the right way to do it.

@stale
Copy link

stale bot commented Apr 19, 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 Apr 19, 2022
@ShaMan123 ShaMan123 added text and removed stale Issue marked as stale by the stale bot labels Apr 19, 2022
@ShaMan123 ShaMan123 mentioned this pull request Apr 26, 2022
48 tasks
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2022

Code Coverage Summary

> fabric@5.1.0 coverage:report
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |   82.85 |    75.66 |   85.68 |   82.57 |                                               
 fabric.js |   82.85 |    75.66 |   85.68 |   82.57 | ...,30947,31021,31032-31097,31220,31319,31555 
-----------|---------|----------|---------|---------|-----------------------------------------------

@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
@igalya
Copy link

igalya commented Dec 12, 2022

@ShaMan123 hi there, I'm working with RTL direction in textBox, In version 4.6 it has problems with selection when text is aligned to center or right.
I checked 5.2.4 and it seems to be all messed up.
Am I missing something?
Here's an example.
http://jsfiddle.net/Igal_lib/bxm0j2Lv/7/

@ShaMan123
Copy link
Contributor Author

This PR isn't merged so it is obvious your fiddle is broken.
http://jsfiddle.net/7f916mpj/1/

@igalya
Copy link

igalya commented Dec 12, 2022

oh, thanks.
is there a merged version that implements RTL text selection ?

@ShaMan123
Copy link
Contributor Author

No
The demo uses a branch with a few fixes to text and others.
I am committed to this fix so I hope I will get to migrating it to v6 soon, then merging.
Contributions are welcome

@ShaMan123
Copy link
Contributor Author

Home End still broken

@igalya
Copy link

igalya commented Dec 12, 2022

I wish I could help but I can't at the moment.
Thanks for your prompt replay and best of luck!

@faizux
Copy link

faizux commented Aug 1, 2023

@ShaMan123 Many thanks for the RTL update. I successfully integrated fabric-rtl@5.1.0 into my project, and it's working well. However, I encountered some issues after downgrading from fabric@5.3.0, which I was previously using. I wonder if you have a similar implementation for fabric@5.3.0 that can be used? TY

@ShaMan123
Copy link
Contributor Author

I plan to migrate it to v6.
Hopefully published in 6.1 but can't promise
I recommend all devs to migrate to v6. Too many fixes to miss out

@ShaMan123 ShaMan123 linked an issue Sep 22, 2023 that may be closed by this pull request
4 tasks
@ShaMan123 ShaMan123 added the stale Issue marked as stale by the stale bot label May 7, 2024
@oustr
Copy link

oustr commented Jun 12, 2024

I plan to migrate it to v6. Hopefully published in 6.1 but can't promise I recommend all devs to migrate to v6. Too many fixes to miss out

I still encountered text selection problems when direction is "rtl" and textAlign is "right", that I couldn't select any part of the text, and when I click in the middle of the text the cursor is always at the right. My version of fabricjs is "^6.0.0-beta19", and I wonder if this bug is solved or not as all the rtl issues and discussions I found here on github still confuse me a lot😥 @ShaMan123 Seems the fix is still not merged?

@stale stale bot removed the stale Issue marked as stale by the stale bot label Jun 12, 2024
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.

[Feature]: RTL Support On text box and i-text RTL text rendering issue when text wraps in new line
6 participants