Skip to content

fix(util): use querySelector for ids#27053

Merged
Johann-S merged 1 commit intov4-devfrom
v4-dev-jo-ids
Aug 12, 2018
Merged

fix(util): use querySelector for ids#27053
Johann-S merged 1 commit intov4-devfrom
v4-dev-jo-ids

Conversation

@Johann-S
Copy link
Copy Markdown
Member

@Johann-S Johann-S commented Aug 11, 2018

We should not use getElementById for selectors with multi ids

/CC @XhmikosR

@Johann-S Johann-S merged commit eab9da5 into v4-dev Aug 12, 2018
@Johann-S Johann-S deleted the v4-dev-jo-ids branch August 12, 2018 15:01
@mdo mdo mentioned this pull request Aug 12, 2018
Comment thread js/src/util.js

const validSelector = selector
if (selector.charAt(0) === '#') {
if (selector.charAt(0) === '#' && selector.indexOf(',') === -1) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

  1. Spaces, e.g. #my-id div
  2. Combinators like + and >, e.g. #my-id>div, #my-id+div, etc

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're totally right @glebm I'll fix that asap thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants