Skip to content
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

Fix contains method to use .contains for DOMTokenList #3299

Merged
merged 1 commit into from
Jul 8, 2019
Merged

Fix contains method to use .contains for DOMTokenList #3299

merged 1 commit into from
Jul 8, 2019

Conversation

Dakkers
Copy link
Contributor

@Dakkers Dakkers commented Jul 8, 2019

What does this PR do?

Fixes a bug I ran into. I had custom style tags, whose value and tag were "div". When I selected some text and changed the style tag to be one of these "div" styles, and then hit "Enter" a couple of times, I got .indexOf is not a function.

Where should the reviewer start?

There's only 1 file.

How should this be manually tested?

  1. use a custom style tag that doesn't map to a header tag (I used a div)
  2. highlight some text
  3. use the custom style tag
  4. de-select
  5. hit Enter a couple of times
  6. error shows in console

example custom style tags:

styleTags: [
  { title: 'BV Title 1', tag: 'h1', className: 'bv-title-1', value: 'h1' },
  { title: 'BV Title 2', tag: 'div', className: 'bv-title-2', value: 'div' },
  { title: 'BV Title 3', tag: 'div', className: 'bv-title-3', value: 'div' },
  { title: 'BV Title 4', tag: 'div', className: 'bv-title-4', value: 'div' },
  { title: 'BV Title 5', tag: 'div', className: 'bv-title-5', value: 'div' }
]

in this case, the "BV Title 1" works just fine. "BV Title 2" and others do not.

Any background context you want to provide?

N/A

What are the relevant tickets?

Not sure.

Screenshot (if for frontend)

Checklist

  • added relevant tests
  • didn't break anything
  • ...

@hackerwins hackerwins added this to the v0.8.13 milestone Jul 8, 2019
@hackerwins
Copy link
Member

@Dakkers Thanks for the contribution.

@hackerwins hackerwins merged commit cebd30d into summernote:develop Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants