admin管理员组文章数量:1287584
- when I click chip chipName="button test IPA" a popup opens.
- I am trying to remove padding from the ul tag of that popup.
- but the problem is I am not able to find the ul tag in my html of jsx.
- I gave className in the react code but still I am not able to target
- can you please help me so that in future I will fix it myself.
- providing code snippet below
tab-demo.js
<td>
<ChipsButton
className={classes.chipContainer}
chipName="button test IPA"
// menuItems={IPAMenuItems}
//ChipsButton
/>
</td>
**chips-dialog.js**
<Menu
className={classes.chipButtonContainer}
id="simple-menu"
// anchorEl={anchorEl}
open={open}
onClose={this.handleClose}
>
<MenuItem className={classes.chipButtonContainerHeader}>
{this.state.menuText}
</MenuItem>
<Button
className={classes.chipButtonContainerButton}
key={1}
style={{
backgroundColor:
this.state.menuText === "Active selected" ? "green" : ""
}}
// style={{ display: this.state.display ? "none" : "" }}
// aria-owns={anchorEl ? 'simple-menu' : undefined}
aria-haspopup="true"
value={"Active"}
onClick={this.handleSelect}
>
Active
</Button>
<Button
key={2}
style={{
backgroundColor:
this.state.menuText === "Inactive selected" ? "green" : ""
}}
value={"Inactive"}
// style={{ display: this.state.display ? "none" : "" }}
// aria-owns={anchorEl ? 'simple-menu' : undefined}
aria-haspopup="true"
onClick={this.handleSelect}
>
Inactive
</Button>
</Menu>
const styles = theme => ({
chipButtonContainer: {
border: "1px solid brown",
padding: "0"
},
chipButtonContainerHeader: {
backgroundColor: "green",
border: "1px solid pink"
},
chipButtonContainerButton: {
border: "1px solid black"
}
})
;
- when I click chip chipName="button test IPA" a popup opens.
- I am trying to remove padding from the ul tag of that popup.
- but the problem is I am not able to find the ul tag in my html of jsx.
- I gave className in the react code but still I am not able to target
- can you please help me so that in future I will fix it myself.
- providing code snippet below
https://codesandbox.io/s/qqqk23x3q
tab-demo.js
<td>
<ChipsButton
className={classes.chipContainer}
chipName="button test IPA"
// menuItems={IPAMenuItems}
//ChipsButton
/>
</td>
**chips-dialog.js**
<Menu
className={classes.chipButtonContainer}
id="simple-menu"
// anchorEl={anchorEl}
open={open}
onClose={this.handleClose}
>
<MenuItem className={classes.chipButtonContainerHeader}>
{this.state.menuText}
</MenuItem>
<Button
className={classes.chipButtonContainerButton}
key={1}
style={{
backgroundColor:
this.state.menuText === "Active selected" ? "green" : ""
}}
// style={{ display: this.state.display ? "none" : "" }}
// aria-owns={anchorEl ? 'simple-menu' : undefined}
aria-haspopup="true"
value={"Active"}
onClick={this.handleSelect}
>
Active
</Button>
<Button
key={2}
style={{
backgroundColor:
this.state.menuText === "Inactive selected" ? "green" : ""
}}
value={"Inactive"}
// style={{ display: this.state.display ? "none" : "" }}
// aria-owns={anchorEl ? 'simple-menu' : undefined}
aria-haspopup="true"
onClick={this.handleSelect}
>
Inactive
</Button>
</Menu>
const styles = theme => ({
chipButtonContainer: {
border: "1px solid brown",
padding: "0"
},
chipButtonContainerHeader: {
backgroundColor: "green",
border: "1px solid pink"
},
chipButtonContainerButton: {
border: "1px solid black"
}
})
;
Share Improve this question edited Nov 17, 2018 at 1:22 asked Nov 16, 2018 at 21:45 user10509524user10509524 4- There's not enough here to go on. We can't reproduce your problem with the given code. – Will Commented Nov 16, 2018 at 22:56
- @Will sorry forgot to paste the sandbox link....updated the question – user10509524 Commented Nov 17, 2018 at 1:24
- That is a lot of code. Looks like this class is the culprit: .MuiList-padding-270 { padding-top: 8px; padding-bottom: 8px; } – Will Commented Nov 17, 2018 at 1:56
- @Will how to remove that padding...is there any way can we overwrite MuiList – user10509524 Commented Nov 17, 2018 at 9:08
2 Answers
Reset to default 12Forward MenuListProps
to the underlying List
ponent (MenuList
poses with this) to disable padding applied to it.
This edit can be made in chips-dialog.js
<Menu
className={classes.chipButtonContainer}
//...
MenuListProps={{ disablePadding: true }}
onClose={this.handleClose}
>
<!--...-->
</Menu>
Works the same for the <Select>
ponent with MenuProps
<Select
multiple
input={<Input />}
MenuProps={{
MenuListProps: {
disablePadding: true
}}>
{employees.map((employee) => (
<MenuItem key={employee.id} value={employee.id}>
{employee.name}
</MenuItem>
))}
</Select>
本文标签: javascripttrying to remove padding from the ul tag of the popupStack Overflow
版权声明:本文标题:javascript - trying to remove padding from the ul tag of the popup - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741272827a2369562.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论