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

Adding a <meta name="viewport"> tag using the <Head> component adds a new tag instead of replacing the default one #2576

Open
viktormarinho opened this issue Jul 3, 2024 · 1 comment

Comments

@viktormarinho
Copy link

Here is a minimal code example that is able to reproduce the problem:

import { Head } from "$fresh/runtime.ts";
import { defineApp } from "$fresh/server.ts";

export default defineApp(async (_req, ctx) => {

  return (
    <>
      <Head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
      </Head>
    </>
  );
});

Resulting HTML is:

Captura de Tela 2024-07-03 às 15 25 01

I expected the default meta viewport tag to be replaced. I could not find where this "default" was being introduced to the document in the fresh codebase in a quick search, though.

@viktormarinho
Copy link
Author

update: Some devices are working (have their zoom in behavior blocked), while others don't (either they cannot handle the last tag overriding the first one or they just ignore it), which i think should be the default behavior... although im not sure where this is specified.
Maybe we just can't block zooming in some devices.

Anyways, I believe having two meta viewport tags is not desirable so the issue still stands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant