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

Bad position at the end of line before wrapped word in Firefox #24

Open
matusjuraj opened this issue Nov 26, 2015 · 5 comments
Open

Bad position at the end of line before wrapped word in Firefox #24

matusjuraj opened this issue Nov 26, 2015 · 5 comments

Comments

@matusjuraj
Copy link

Environment: Mozilla Firefox 42
Situation:
Several words in line, the last one long enough to be put into a new line. Navigate to the end of the last non-wrapped word and go once to the right.
Problem:
Real caret stayed in the first line, after some "imaginary Firefox space", while library caret was at the beginning of the next line.

In my opinion it's more of a Firefox bug, since the position of the real caret is indeed weird. But since this library should find position of caret and not a position of optimal placement of caret, I file it as bug.

Demonstration of described situation is here:
selection_041

@yesasha
Copy link

yesasha commented Mar 26, 2016

Seems the same bug. Even with provided text. Not just in firefox, but in chrome, too.
caret

@z4none
Copy link

z4none commented Dec 15, 2016

I think it coudle be sloved by change the span.textContent from '.' to ' '(space character),
in index.js line 107

@dandv
Copy link
Member

dandv commented May 24, 2017

@matusjuraj: this is actually a dupe of #9.

@sasha85: I can no longer reproduce that in Chrome 58, but it does reproduce in Firefox 53. Can you verify?

@z4none: that didn't work, but I've added testing instructions, so feel free to suggest a solution.

@bplevin36
Copy link

I experienced a similar issue to this in Chrome 63. The nonzero width of the period in the span appended to the hidden element causes a line wrap that is not in the original textarea. Changing the period to a space solved the issue for me. I'd make a pull request, but this seems like such a trivial fix that there must be a situation I don't know about that breaks it.

@lcswillems
Copy link

I still have the same bug 2 years later with Chrome 78. It is also under Firefox, but I don't think the library could do anything about it.

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

No branches or pull requests

6 participants