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 using uppercase in element name #358

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

hacknug
Copy link

@hacknug hacknug commented Nov 24, 2021

This PR makes the default name for the portal element lowercase. Some linters don't like it when you use uppercase characters for this and, given browsers turn element and attribute names to lowercase when rendering the page, it's somewhat hard to know where the issue/warning comes from.

More info:

Let me know if you'd like me to make any changes to this PR before mergin it in 👍

@LinusBorg
Copy link
Owner

I'd be interested to to learn where a linter might protest about this?

I used uppercase as tagNames are in fact uppercase in JS DOM:

const div1 = document.createElement('DIV')
const div2 = document.createElement('div')
div1.tagName // => 'DIV'
div2.tagName // => 'DIV'

Given that Vue uses document.createElement to create elements, and given how that API doesn't care about the casing of it's argument, I struggle to see at which point a linter could cause trouble here?

@hacknug
Copy link
Author

hacknug commented Nov 25, 2021

Of course! I'm using @nuxtjs/html-validator and it complains when I don't have tag="div" because of it.

Attaching a screenshot to show the logged error and generated HTML:

  • Captura de pantalla 2021-11-25 a las 12 27 02
  • Captura de pantalla 2021-11-25 a las 12 34 23

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