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

Responsive layouts not working on mobile phone #5122

Closed
dbrowne24 opened this issue Sep 8, 2018 · 5 comments
Closed

Responsive layouts not working on mobile phone #5122

dbrowne24 opened this issue Sep 8, 2018 · 5 comments

Comments

@dbrowne24
Copy link

Bug report

Describe the bug

I have created a next js application. I have used both semantic ui and bootstrap to create some simple responsive layouts in pages/index.js

These layouts are pretty much just some grids that should collapse on smaller screens such as mobiles.

I have deployed the app to a server. I'm using pm2 to manage the app and nginx as a reverse proxy.

Everything works perfectly on a computer. You can shrink the screen and at the breakpoint the grids collapse the way that they should. If you shrink the browser and load the app it looks perfect.

However when I access the site from my phone's web browser (chrome) it does not collapse. So everything looks very small and squashed.
My phone is a samsung galaxy A5 (android)

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create a basic next application with either bootstrap or semanti-ui-react
  2. Deploy the application to a server
  3. Use pm2 to manage the application
  4. Use nginx to reverse proxy
  5. Access the application from a mobile phone (android at least)

Here is a repo to the code I have deployed:
https://github.com/dbrowne24/bootstrap-nextjs-issues

This example uses bootstrap, but the same thing happens when using semantic-ui-reacts responsive layouts.

Expected behavior

Expected the responsive layout to work on both mobile and desktop.

Screenshots

Here are some screen shots that might help:

Computer Full Screen:
screenshot from 2018-09-08 02-02-04

Computer Window shrank:
screenshot2

Mobile Phone (no responsiveness)
screenshot_20180908-020129_chrome

System information

  • OS: Ubuntu 18.04 and Android
  • Browser Chrome on both
  • Version of Next.js: 6.1.2

Additional context

Add any other context about the problem here.

@timneutkens
Copy link
Member

This is not a Next.js bug. You probably forgot to add the viewport meta tag:

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

@Nahueleti
Copy link

had a similar issue, @timneutkens pointed in the right direction, thanks a bunch!

@timneutkens
Copy link
Member

🙏 this bites a lot of people doing responsive websites unfortunately 😅

@DiegoVallejoDev
Copy link

How can I add meta tags in nextjs?

@whoyawn
Copy link

whoyawn commented Oct 21, 2018

@Destructor1702 https://nextjs.org/docs#populating-head

@lock lock bot locked as resolved and limited conversation to collaborators Oct 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants