noob
noob
KPCKevin Powell - Community
Created by noob on 12/24/2024 in #front-end
how to change the default style of selected radio button
It works for me. Thanks
7 replies
KPCKevin Powell - Community
Created by noob on 12/20/2024 in #front-end
how to close a dialog when click on backdrop
Ok guys. I got it
45 replies
KPCKevin Powell - Community
Created by noob on 12/20/2024 in #front-end
how to close a dialog when click on backdrop
great solution. But why I should not use it?
45 replies
KPCKevin Powell - Community
Created by noob on 12/20/2024 in #front-end
how to close a dialog when click on backdrop
I got it. Thanks guys
45 replies
KPCKevin Powell - Community
Created by noob on 12/20/2024 in #front-end
how to close a dialog when click on backdrop
ahh. I thought they were the same
45 replies
KPCKevin Powell - Community
Created by noob on 12/20/2024 in #front-end
how to close a dialog when click on backdrop
As I know closing dialog when clicking on backdrop is common behavior. So I wonder how to do it
45 replies
KPCKevin Powell - Community
Created by noob on 12/20/2024 in #front-end
how to close a dialog when click on backdrop
great. Thank you
45 replies
KPCKevin Powell - Community
Created by noob on 12/2/2024 in #front-end
margin-top: auto does not work inside a element
I thought margin-top or bottom auto would work ifthe display is not inline. Thank you
4 replies
KPCKevin Powell - Community
Created by noob on 11/20/2024 in #front-end
how to style for nested item
here is html and css I use: https://jsbin.com/kahaburocu/edit?html,css,output I'm using a function to recursive render the nested item like this
const handleRenderChildRoles = (roles: Role[], level: number) => {
return roles.map((role, index) => (
<React.Fragment key={role.id}>
<tr className={classes.row}>
<td> {!level && role.id}</td>
<td
style={{
marginLeft: `${25 * level}px`,
paddingLeft: level ? `30px` : "18px",

display: "block",
}}
className={level ? classes.subRow : ""}>
{!!level && (
<div
style={{
position: "absolute",
height: !index ? "70%" : "100%",
width: "25px",
top: index ? "-50%" : "-20%",
left: "0",
borderLeft: "1px solid #000",
borderBottom: "1px solid #000",
}}></div>
)}
{role.name}
</td>
<td>
<Popover
overlayInnerStyle={{
padding: 0,
}}
content={
<PopoverContent
onClickEdit={onClickEditOption}
onClickDelete={onClickDelete}
/>
}
placement="bottom"
trigger="click">
<Gear
onClick={() => onClickGearIcon(role)}
size={22}
style={{
margin: "auto",
display: "block",
cursor: "pointer",
}}
/>
</Popover>
</td>
</tr>
{!!role.child_role.length &&
handleRenderChildRoles(role.child_role, level + 1)}
</React.Fragment>
));
};
const handleRenderChildRoles = (roles: Role[], level: number) => {
return roles.map((role, index) => (
<React.Fragment key={role.id}>
<tr className={classes.row}>
<td> {!level && role.id}</td>
<td
style={{
marginLeft: `${25 * level}px`,
paddingLeft: level ? `30px` : "18px",

display: "block",
}}
className={level ? classes.subRow : ""}>
{!!level && (
<div
style={{
position: "absolute",
height: !index ? "70%" : "100%",
width: "25px",
top: index ? "-50%" : "-20%",
left: "0",
borderLeft: "1px solid #000",
borderBottom: "1px solid #000",
}}></div>
)}
{role.name}
</td>
<td>
<Popover
overlayInnerStyle={{
padding: 0,
}}
content={
<PopoverContent
onClickEdit={onClickEditOption}
onClickDelete={onClickDelete}
/>
}
placement="bottom"
trigger="click">
<Gear
onClick={() => onClickGearIcon(role)}
size={22}
style={{
margin: "auto",
display: "block",
cursor: "pointer",
}}
/>
</Popover>
</td>
</tr>
{!!role.child_role.length &&
handleRenderChildRoles(role.child_role, level + 1)}
</React.Fragment>
));
};
7 replies
KPCKevin Powell - Community
Created by noob on 11/20/2024 in #front-end
how to style for nested item
No description
7 replies
KPCKevin Powell - Community
Created by noob on 11/20/2024 in #front-end
how to style for nested item
My layout is a table and all rows include nested rows will have an icon in the last column. How can I handle this problem?
7 replies