Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Fix highlighting bugs #1149 and #1142 by preventing nested highlight <span>'s - #1193

Merged
joallard merged 3 commits into
selectize:masterfrom
micahjon:bugfix-highlight
Nov 16, 2016
Merged

joallard merged 3 commits into
selectize:masterfrom
micahjon:bugfix-highlight

Conversation

@micahjon

@micahjon micahjon commented Nov 4, 2016

Copy link
Copy Markdown
Contributor

No description provided.

@micahjon

micahjon commented Nov 4, 2016

Copy link
Copy Markdown
Contributor Author

Feel free to adjust the comments as needed. I figured they'd help with refactoring down the road.

@joallard

joallard commented Nov 4, 2016

Copy link
Copy Markdown
Member

Thanks, I'll try to test soon

@joallard joallard added this to the 0.12.5 milestone Nov 4, 2016
@micahjon

micahjon commented Nov 9, 2016

Copy link
Copy Markdown
Contributor Author

@joallard, I did run all the tests before submitting this PR, so hopefully this is an easy merge on your end. Thanks again. Looking forward to having this bugfix live!

@joallard

Copy link
Copy Markdown
Member

I'm really out of time here and I think i've seen other PRs tackling the same bug, so that leaves me a little puzzled without having tested it. Real sorry about that by the way. If you'd be able to give me some reassurance it's really fixed, I'd be down to merge.

@coveralls

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling e6bcc6c on pranksinatra:bugfix-highlight into * on selectize:master*.

@micahjon

micahjon commented Nov 15, 2016 •

Copy link
Copy Markdown
Contributor Author

No problem. I added a test for this bugfix based on Wardrop's example in #1142, and also wrote (and passed) a test for nextriot's example in #1149, which I omitted from the PR b/c they test the same thing.

I couldn't find other PR's also solving this issue, but I did create a test (locally) for the other highlighting issue (first character, #1141), and have verified that my bugfix does not resolve it (though I'm guessing the #1169 patch does..)

I don't have time to wade into #1141 tonight but if you'd like to try out this test, go for it!

it('should not continue highlighting first-matched letter if input is backspaced', function(done) {
    var test = setup_test('<select>' +
        '<option></option>' +
        '<option value="a">Cleveland</option>' +
        '<option value="b">Cincinnati</option>' +
        '<option value="c">San Francisco</option>' +
    '</select>', {});

    click(test.selectize.$control, function() {
        syn.type('cin', test.selectize.$control_input)
        syn.type('\b\b\b', test.selectize.$control_input)
        .delay(0, function() {
            expect(test.selectize.$dropdown_content.find('.highlight').length).to.be.equal(0);
            done();
        });
    });
});

@joallard

Copy link
Copy Markdown
Member

That sounds great @pranksinatra , thanks!

@bs-thomas

Copy link
Copy Markdown

This is great, but I was wondering when this will be officially released. It seems like it has been more than a year already.

Is the project being maintained anymore?

@jag2136 jag2136 mentioned this pull request Jan 5, 2018
1 task
@trudynamica

Copy link
Copy Markdown

I did test the changes in my code and now it works as intended now. This fixes the #1345

@micahjon
micahjon deleted the bugfix-highlight branch February 19, 2018 05:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants