简体   繁体   English

移动 Chrome 浏览器不显示我的 div 或结果数据

[英]Mobile chrome browser doesn't display my div or results data

I have the following piece of React code on my website that shows the search results div only if the search results exist.我的网站上有以下一段 React 代码,仅当搜索结果存在时才显示搜索结果 div。 The backend limits search results to only 20 items at a time, and each item is a dictionary with only three key-value pairs.后端将搜索结果一次限制为 20 个项目,每个项目都是一个只有三个键值对的字典。

This works perfectly on all desktop browsers and also Firefox on Android.这适用于所有桌面浏览器以及 Android 上的 Firefox。 But on Android Chrome the search results never show .在 Android Chrome 上,搜索结果从不显示 I've tried changing the display to always block, letting the height and width be undefined, and tons of different formatting changes.我尝试将显示更改为始终阻止,让高度和宽度未定义,并更改了大量不同的格式。

Is there something related to div height or data displayed for mobile Chrome?是否有与为移动 Chrome 显示的 div 高度或数据相关的内容? Has anyone encountered this?有没有人遇到过这个?

<div
  style={{
    height: 150,
    width: "100%",
    overflowY: "scroll",
    display: this.props.hasSearchResults ? "" : "None"
  }}
>
  {/* switch to a div */}
  {/* <List> */}
  {this.props.search_results.map((result, idx) => (
    <div>
      <IconButton
        size="small"
        edge="end"
        onClick={event => {
          this.handleMenuAdd(event, result);
        }}
        style={{height: "100%"}}
      >
        <AddIcon
          style={{margin: "auto"}}
          fontSize="small"
        />
      </IconButton>
      <Typography
        style={{verticalAlign: "bottom"}}
        noWrap={true}
        // display="block"
        variant="caption"
      >
        {result.name}
      </Typography>
      <Typography
        variant="caption"
        style={{marginLeft: 10}}
        noWrap={true}
      >
        {result.item_type}
      </Typography>
    </div>
  ))}
</div>

Thank you all for your attention and input.感谢大家的关注和投入。 The problem was serverside.问题是服务器端。 It simply wasn't lowercasing the search query.它只是没有小写搜索查询。 In Chrome the input was being automatically capitalized and in Firefox it wasn't.在 Chrome 中,输入会自动大写,而在 Firefox 中则不是。 Feeling silly but will leave this here in case someone else needs to see it.感觉很傻,但会留在这里以防其他人需要看到它。

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

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