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

Calculate and use scrollbar width as needed #26

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

Conversation

Mottie
Copy link
Contributor

@Mottie Mottie commented Nov 28, 2015

This will fix #21 for IE (only tested in Edge). The caret will properly align in the demo.

Specific changes:

  • Removed border properties as they are not needed for the mirror div.
  • Width & overflow removed from the properties list as they get special treatment.
  • Added getScrollbarWidth function.
  • The scrollbar is now included in width calculations and when creating the mirror div, if there are overflows.

This change was tested in the most recent versions of Chrome, Firefox and Opera. I don't own an Apple device, so I didn't test it in Safari.

* NOTE * An issue still remains with IE because the input does not return a scrollLeft value (other than zero). So, as you type in the input, it scrolls to keep the caret in view, but the calculated caret position continues to increase.

@Mottie
Copy link
Contributor Author

Mottie commented Feb 20, 2016

Updated to fix merge conflicts. Tested in MS Edge and still working as expected.

@dandv
Copy link
Member

dandv commented May 24, 2017

Hi @Mottie, I've resumed maintenance of this project. Can you please have a second look? If the issue is still reproducible, would you mind rebasing?

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.

IE11
2 participants