Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

bug(autocomplete): text highlighting is broken for escaped characters #8388

@robertmesserle

Description

@robertmesserle

image

You can recreate this using the following CodePen:
http://codepen.io/anon/pen/zqeywG?editors=1010

What's going on

The issue only occurs when your search includes a special character (ie. <, >, &). It will break in one of two ways:

  • When your search ends with &, it will be searching the actual HTML which looks like Alabama &amp; something in this case. It will match the & in &amp; and the highlight <span> will split the special character, causing the results seen in the screenshot above.
  • When searching for other special characters, it will simply not highlight anything.

Solution

We need to make sure that we are searching the textContent and not the innerHTML of the element.

Metadata

Metadata

Assignees

Labels

g3: reportedThe issue was reported by an internal or external product team.has: Pull RequestA PR has been created to address this issuetype: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions