garysieling / garysieling/jquery-highlighttextarea

IE not synchronizing scroll from input ScrollLeft to Highlight Area in INPUT tags

Open
#35 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
157
Forks
72
PR merge metrics
No merged PRs in 30d

Description

Hi,

My code is as follows. As simple as this:

``` javascript
(function($) {
$(document).ready(function() {
$("#e5")
.highlightTextarea({
caseSensitive: false,
words: ['test']
});
});
}(jQuery));
```

``` html

```

The outcome is like this:
![screenshot_1](https://cloud.githubusercontent.com/assets/5934048/5296703/49aec6ba-7ba7-11e4-8923-3a75ba2e66cc.png)

Then if I move to the right of my input, the highlighter component is expected to move as well but it doesn't.
![screenshot_2](https://cloud.githubusercontent.com/assets/5934048/5296720/62415850-7ba7-11e4-8094-f1ef4e092e5b.png)

The inner left css is always **0** for the hightlighter div. Debugging the code I have found that in IE only the function **Highlighter.prototype.updateSizePosition** in the following section:

``` javascript
this.$highlighter.css({
'width': width,
'height': this.$el.height() + this.$el.scrollTop(),
'top': -this.$el.scrollTop(),
'left': -this.$el.scrollLeft()
});
```

uses the sentence **this.$el.scrollLeft()**. This is ALWAYS 0. I haven't found anything on the internet about this issue with IE. Could you please help out?

By te way, I am using jquery-2.1.1.js and I changed the css for the highlighted test as part of my debug to find out the problem. I just removed the color:transparent sentence from .highlightTextarea .highlighter.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.