代码之家  ›  专栏  ›  技术社区  ›  Valentin Petkov

材料UI自动完成groupBy标题的自定义CSS

  •  0
  • Valentin Petkov  · 技术社区  · 3 年前

    我有来自AJAX+JSON的材料UI自动完成加载

    我想为groupBy的标题定制CSS背景和颜色

    enter image description here

    到目前为止,所有选项的背景都正常

      autoHighlight={true}
    
      PaperComponent={({ children }) => (
        <Paper style={{ background: "#EBEBEB" }}>{children}</Paper>
      )} 
    
      renderInput={params => ( 
        <TextField  
          {...params}
          label="Country/District"
          variant="outlined"
      
          
          InputProps={{
            ...params.InputProps,  
            endAdornment: ( 
              <React.Fragment>
                {this.state.loadingCity ? (
                  <CircularProgress color="inherit" size={20} />
                ) : null}
                {params.InputProps.endAdornment}
               
                  <InputAdornment position="end">
              <SearchIcon />
            </InputAdornment>
              </React.Fragment>
            
            )
          }}
    
    0 回复  |  直到 3 年前