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

Docs: blank screen when resizing web page #2756

Closed
ayuthmang opened this issue May 1, 2018 · 8 comments
Closed

Docs: blank screen when resizing web page #2756

ayuthmang opened this issue May 1, 2018 · 8 comments

Comments

@ayuthmang
Copy link

ayuthmang commented May 1, 2018

If I resizing browser window width between 768 - 992 pixels I got blank page like this.
This problem was found in only react semantic only, normal html react page works normally.
I also clone and built Semantic-UI-React project and I got same problem.

Steps

  1. Try to open this page https://react.semantic-ui.com/layouts/homepage
  2. Open developer tools or try to resize width between 768 - 992 pixels.
  3. You'll got blank page.

gif image: https://photos.app.goo.gl/2tG9BZ2miptCPLvw7

Version

v0.79.1

@welcome
Copy link

welcome bot commented May 1, 2018

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@ayuthmang ayuthmang changed the title Blank screen when resizing web Blank screen when resizing web page May 1, 2018
@nsantosdaveiga
Copy link

Hi I have the same issue, I hope someone can respond us as soon as possible

@fspinnenhirn
Copy link
Contributor

The "Homepage" starter page template defines two responsive components DesktopContainer and MobileContainer, which each render a <Responsive> root element:

// DesktopContainer
 <Responsive {...Responsive.onlyComputer}>

// ...

// MobileContainer
 <Responsive {...Responsive.onlyMobile}>

In Semantic-UI-React's Responsive add-on, the attributes that restrict visibility to a "device" are defined as:

  static onlyMobile = { minWidth: 320, maxWidth: 767 }
  static onlyTablet = { minWidth: 768, maxWidth: 991 }
  static onlyComputer = { minWidth: 992 }
  static onlyLargeScreen = { minWidth: 1200, maxWidth: 1919 }
  static onlyWidescreen = { minWidth: 1920 }

As you can see, widths between 768 - 991 fall into the "tablet" category and not into "mobile" or "computer". Nothing will display when your window width is in the tablet range, because the starter template doesn't define any components other than the two mentioned above. It's up to you to take the layout template as a starting point and modify it to your needs.

@nsantosdaveiga
Copy link

nsantosdaveiga commented May 9, 2018

Hi @fspinnenhirn, the problem is when I use onlyTablet you have the page only on landscape mode and no on portrait...

I don't want to do something like that :

let responsiveConfig = Responsive.onlyTablet
responsiveConfig.minWidth = 0
return (
    <Responsive {...responsiveConfig}>

@fspinnenhirn
Copy link
Contributor

@nsantosdaveiga I'm not sure what you're trying to do, or if this is the right forum for asking, but in general, I'd suggest to determine what you'd like to display at which breakpoints and declare your Responsive components based on that.

For example, if you only want two layout styles, one for mobile and one for everything else, you could do the following (see codesandbox for full example):

const notMobile = { minWidth: Responsive.onlyMobile.maxWidth + 1 };

const DesktopContainer = ({ children }) => (
  <Responsive {...notMobile}>{children}</Responsive>
);

const MobileContainer = ({ children }) => (
  <Responsive {...Responsive.onlyMobile}>{children}</Responsive>
);

@nsantosdaveiga
Copy link

nsantosdaveiga commented May 9, 2018

Thanks @fspinnenhirn, I understand now this is more a uncomplete feature than a bug !

@levithomason
Copy link
Member

@fspinnenhirn Your investigations and examples are incredibly helpful, thanks!

widths between 768 - 991 fall into the "tablet" category and not into "mobile" or "computer". Nothing will display when your window width is in the tablet range, because the starter template doesn't define any components other than the two mentioned above.

Does someone want to update the layout to be more intuitive to users? I think we should define some content for tablet as well so we don't this issue.

@levithomason levithomason added docs and removed bug labels May 11, 2018
@Abdul-Moiz-Ansari
Copy link

Is it up for grabs? I would love to do it..

@layershifter layershifter changed the title Blank screen when resizing web page Docs: blank screen when resizing web page Jul 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants