Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material-UI vertical ToggleButtonGroup style error with border

I am using React Material UI ToogleButtonGroup for my front end project.

https://codesandbox.io/s/eyk66?file=/demo.js

This is Material UI ToggleButtonGroup Multiple Selection example code. I changed it as vertical style.

when I select two or more buttons then left border of buttons are disappeared. enter image description here

I added border color to each Toggle Button but no lucky. enter image description here Please help me!

like image 309
HiKangg Avatar asked Nov 25 '25 09:11

HiKangg


1 Answers

I've found out solution myself.

 style={{outlineColor: 'red', outlineWidth: '1px', outlineStyle: 'solid', margin: '2px'}}

Instead of style={{borderColor: 'red'}} I used outlined css. It shows borders perfectly.

When we add above style to every ToggleButton we can see every borders.

<ToggleButtonGroup value={formats} orientation="vertical" onChange={handleFormat} aria-label="text formatting">
  <ToggleButton value="bold" aria-label="bold" style={{outlineColor: 'red', outlineWidth: '1px', outlineStyle: 'solid', margin: '2px'}}>
    <FormatBoldIcon />
  </ToggleButton>
  <ToggleButton value="italic" aria-label="italic" style={{outlineColor: 'red', outlineWidth: '1px', outlineStyle: 'solid', margin: '2px'}}>
    <FormatItalicIcon />
  </ToggleButton>
  <ToggleButton value="underlined" aria-label="underlined" style={{outlineColor: 'red', outlineWidth: '1px', outlineStyle: 'solid', margin: '2px'}}>
    <FormatUnderlinedIcon />
  </ToggleButton>
  <ToggleButton value="color" aria-label="color" disabled style={{outlineColor: 'red', outlineWidth: '1px', outlineStyle: 'solid', margin: '2px'}}>
    <FormatColorFillIcon />
    <ArrowDropDownIcon />
  </ToggleButton>
</ToggleButtonGroup>

enter image description here

Thanks for your help everybody!!!

like image 145
HiKangg Avatar answered Nov 28 '25 03:11

HiKangg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!