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

[Feature Request] Discriminate <Meta> overrides base on other attributes too #29

Open
thepra opened this issue Mar 11, 2022 · 5 comments

Comments

@thepra
Copy link

thepra commented Mar 11, 2022

As of now it does seem that the Name property is the only one being used for search and override so if you have some other extra attribute distinguising the <meta>s it does only override the first match by Name, ex.:

<meta name="theme-color" media="(prefers-color-scheme: light)" content="hsl(25,84%,88%)">
<meta name="background-color" media="(prefers-color-scheme: light)" content="hsl(25,84%,88%)">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="hsl(25,16%,12%)">
<meta name="background-color" media="(prefers-color-scheme: dark)" content="hsl(25,16%,12%)">

as you can see there's the media query that can enable different values based on the color-scheme of the OS but the <Meta> component goes and replaces only the first two values leaving the next two untouched.

Is there a way to have implemented search match based also on other attributes?

@thepra thepra changed the title [Feature Request] Discriminate <Meta> overrides base on other arguments too [Feature Request] Discriminate <Meta> overrides base on other attributes too Mar 11, 2022
@jsakamoto
Copy link
Owner

@thepra

I published the new version of the Blazor Head Element Helper NuGet packages v.7.1.0.

This version has supported a media attribute in meta elements and identifies them by whether both of name and media attributes are the same inter meta each element.

Could you try it out?

@thepra
Copy link
Author

thepra commented Apr 1, 2022

sure

@thepra
Copy link
Author

thepra commented May 31, 2022

I'm having an issue, it doesn't seem to work, when specifying Media in the Meta component it does render everything except media:...
immagine

And it does seem also that it doesn't override correctly because there's a copy left above of the same initial meta tags(from index.html)

@jsakamoto
Copy link
Owner

@thepra I've not reproduced that problem yet.

Can you reproduce the problem on my sample app I attached below?

📦BlazorServerApp1.zip

@thepra
Copy link
Author

thepra commented Jun 3, 2022

ok, nevermind, it does seem to be an issue with Firefox in the end. I did already report the issue there and it's being worked on.

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

No branches or pull requests

2 participants