garysieling / garysieling/jquery-highlighttextarea

Highlighting not working properly when setting value of textarea using jquery

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

Description

I have textarea as follows and highlighted word using highlightTextarea:
![textarea1](https://user-images.githubusercontent.com/14745518/42452056-a3994bcc-83a6-11e8-84f2-67dbf9836c2c.png)

````
$('textarea').highlightTextarea({
words: ['brand']
})
````
When I try to set the value of textarea using jquery:
```
$('textarea').val('changed_value == 9')
```
again called following method :
````
$('textarea').highlightTextarea({
words: ['brand']
})
````
then output is as follows:
![textarea2](https://user-images.githubusercontent.com/14745518/42452156-e88bdeb6-83a6-11e8-890c-40d72e22f9f1.png)

It is not reseting the mark tag.
Only after I try to edit the textarea value by typing, it removes the highlighted mark from background.

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.