question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Select] How to disable the underline?

See original GitHub issue

in Select component, property inputProps={{ disableUnderline: true }} doesn’t do anything, it doesn’t disable input’s underline, but I can disable it somehow, indicating clearly input={<Input disableUnderline />}, I think its a bug, can you fix it?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:19
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

146reactions
oliviertassinaricommented, Jun 21, 2021

@bife1 The Select component inherited the properties of the Input component. disabledUnderline is implemented by the Input component. So the answer to your problem is:

import * as React from "react";
import { MenuItem, Select } from "@material-ui/core";

export default function Demo() {
  return (
    <Select
      disableUnderline
      value={10}
      variant="standard"
      inputProps={{
        name: "age",
        id: "age-simple"
      }}
    >
      <MenuItem value="">
        <em>None</em>
      </MenuItem>
      <MenuItem value={10}>Ten</MenuItem>
      <MenuItem value={20}>Twenty</MenuItem>
      <MenuItem value={30}>Thirty</MenuItem>
    </Select>
  );
}
Capture d’écran 2021-06-21 à 17 34 02

https://codesandbox.io/s/84jkyqpvp0

28reactions
amaslakovcommented, May 22, 2019

@bife1 The Select component inherited the properties of the Input component. disabledUnderline is implemented by the Input component. So the answer to your problem is:

<Select disableUnderline />

https://codesandbox.io/s/84jkyqpvp0

@oliviertassinari Maybe you could add this to the doc, Select API page? I ran into the same issue, read the docs, tried inputProps which didn’t work, then googled this solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to remove the underline of material-ui select?
Add the disableUnderline prop to Select . Here's a modified version of your sandbox: ...
Read more >
[Select] How to disable the underline? · Issue #10271 - GitHub
in Select component, property inputProps={{ disableUnderline: true }} doesn't do anything, it doesn't disable input's underline, ...
Read more >
How to Remove the Underline from Links in CSS - HubSpot Blog
Below we'll walk through how to define this property to completely remove the underline from links on your HTML site or Bootstrap site....
Read more >
How to remove underline for anchors tag using CSS?
The underline can be easily remove by using text-decoration property. The text-decoration property of CSS allows to decorate the text according ...
Read more >
Remove the underline from hyperlink text - Microsoft Support
Right-click the hyperlink text, and then click Remove Hyperlink. · On the Insert tab, in the Illustrations group, click Shapes, and then under...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found