Skip to content

Highlight deletes characters on match double-up #1142

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

Closed
Wardrop opened this issue Aug 24, 2016 · 2 comments
Closed

Highlight deletes characters on match double-up #1142

Wardrop opened this issue Aug 24, 2016 · 2 comments
Labels
Milestone

Comments

@Wardrop
Copy link

Wardrop commented Aug 24, 2016

Another highlighting related issue in the master branch. This is best explained with an example, included below. With the blow example, if you type "Isabel", everything is good, but when you start typing the "S" for street (i.e. "Isabel S"), the second "S" rematches the with the "s" in "Isabel". If you continue typing the "t" (i.e. "Isabel St"), the "sabel" is deleted. The whole issue seems to be caused by the fact that highlighting is being applied to already matched words, causing this kind of weirdness.

See related issues #1141 and #1098.

<select id="select-test">
    <option value="">Select a country...</option>
    <option value="AL">Isabel Street</option>
</select>
$('#select-test').selectize();
@Wardrop
Copy link
Author

Wardrop commented Aug 24, 2016

For the moment, for anyone else looking for a work-around, I'm using mark.js.

$('#selector').selectize({
  // ...
  highlight: false,
  onType: function (value) {
    $(".selectize-dropdown-content").unmark().mark(value, {exclude: ['.exclude']});
  }
  // ...
})

@joallard joallard added the bug label Aug 24, 2016
@joallard joallard added this to the 0.13.0 milestone Aug 24, 2016
micahjon added a commit to micahjon/selectize.js that referenced this issue Nov 4, 2016
joallard added a commit that referenced this issue Nov 16, 2016
Fix highlighting bugs #1149 and #1142 by preventing nested highlight <span>'s
Pictor13 pushed a commit to Pictor13/selectize.js that referenced this issue Nov 17, 2016
@risadams
Copy link
Contributor

closing stale issues older than one year.
If this issue was closed in error please message the maintainers.
All issues must include a proper title, description, and examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants