简体   繁体   English

React - 使用 Internet Explorer 在侧面显示白屏

[英]React - White screen displaying on the side with Internet Explorer

The app is working perfectly on every browser except for Internet Explorer 11. IE Display该应用程序在除 Internet Explorer 11 之外的所有浏览器上都能完美运行。 IE 显示

Look how there's a white screen that appears on the side of the map and it moves the buttons on the footer.看看地图一侧出现了一个白色屏幕,它会移动页脚上的按钮。

This is how it should display: Mozilla Right Displaying这是它的显示方式: Mozilla Right Displaying

Why is this happening?为什么会这样? This only happens in IE.这只发生在 IE 中。 Is there an issue with the flexboxs on IE? IE 上的 flexboxs 有问题吗?

Here is part of the code这是代码的一部分

 const NoAuthFooter = props => { const classes = useStyles(); const { classes: propClasses = {} } = props; return ( <Toolbar className={clsx(classes.footbar, propClasses.root)}> <div className={classes.company}> <Typography variant="h6"> Hecho con <SvgHeartBlockyEmpty width="16" height="16" /> &nbsp;por Innovación </Typography> </div> <div className={classes.actions}> <div className={clsx(classes.buttonContainer, classes.rowContainer)}> <LinkButton title="Más cerca de ti" to="/closer" /> </div> <div className={classes.buttonContainer}> <LinkButton id="WebFooter_a_terms" title="Términos" to={{ pathname: ROUTE_NAMES.information, aboutProps: { subject: MENU.terms } }} /> </div> <div className={classes.buttonContainer}> <LinkButton id="WebFooter_a_help" title="Ayuda" to={{ pathname: ROUTE_NAMES.information, aboutProps: { subject: MENU.help } }} /> </div> </div> </Toolbar> ); }; const useStyles = makeStyles(theme => ({ footbar: { position: 'relative', display: 'flex', width: '100%', bottom: 0, boxShadow: '0px 2px 10px -1px rgba(0,0,0,0.2)', backgroundColor: '#FFFFFF' }, company: { flex: 1, color: theme.palette.color.default, '@media (max-width:600px)': { display: 'none' }, [theme.breakpoints.up('lg')]: { flex: 2 } }, companyText: { display: 'inline', fontSize: 12 }, actions: { flex: 1, display: 'flex', justifyContent: 'flex-end', '@media (max-width:600px)': { flex: 1, justifyContent: 'space-around' } }, buttonContainer: { flex: 1, justifyContent: 'center', // * Responsive [theme.breakpoints.up('sm')]: { maxWidth: 160 } }, rowContainer: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start', flex: 2 }, mobileHide: { display: 'none', [theme.breakpoints.up('md')]: { display: 'block' } } }));

Thanks for the help.谢谢您的帮助。

IE browser has below compatibility issues with flexbox. IE 浏览器与 flexbox 存在以下兼容性问题。

  1. IE 11 requires a unit to be added to the third argument, the flex-basis property see MSFT documentation IE 11 需要在第三个参数中添加一个单位,flex-basis 属性请参阅MSFT 文档

  2. In IE10 and IE11, containers with display: flex and flex-direction: column will not properly calculate their flexed childrens' sizes if the container has min-height but no explicit height property.在 IE10 和 IE11 中,如果容器具有 min-height 但没有明确的高度属性,则具有 display: flex 和 flex-direction: column 的容器将无法正确计算其弯曲子项的大小。

  3. IE 11 does not vertically align items correctly when min-height is used使用 min-height 时,IE 11 无法正确垂直对齐项目

  4. In IE10 the default value for flex is 0 0 auto rather than 0 1 auto as defined in the latest spec.在 IE10 中,flex 的默认值是 0 0 auto 而不是最新规范中定义的 0 1 auto。

Reference:参考:

CSS Flexbox CSS 弹性盒

I suggest you refer to the link below that may help to fix the issue.我建议您参考以下可能有助于解决问题的链接。

Fixing Flexbox positioning for IE10 & IE11 修复 IE10 和 IE11 的 Flexbox 定位

If the issue persists then I suggest you post the sample code using only HTML and CSS.如果问题仍然存在,那么我建议您仅使用 HTML 和 CSS 发布示例代码。 We will try to check and test it and try to provide suggestions for it.我们将尝试对其进行检查和测试,并尝试为其提供建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM