Skip to content

Commit d54a871

Browse files
committed
Fix width of dropdown menus
1 parent b2328b5 commit d54a871

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

resources/scripts/components/elements/DropdownMenu.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ class DropdownMenu extends React.PureComponent<Props, State> {
4040
if (this.state.visible && !prevState.visible && menu) {
4141
document.addEventListener('click', this.windowListener);
4242
document.addEventListener('contextmenu', this.contextMenuListener);
43-
menu.setAttribute(
44-
'style', `left: ${Math.round(this.state.posX - menu.clientWidth)}px`,
45-
);
43+
menu.style.left = `${Math.round(this.state.posX - menu.clientWidth)}px`;
4644
}
4745

4846
if (!this.state.visible && prevState.visible) {
@@ -94,6 +92,7 @@ class DropdownMenu extends React.PureComponent<Props, State> {
9492
e.stopPropagation();
9593
this.setState({ visible: false });
9694
}}
95+
style={{ width: '12rem' }}
9796
css={tw`absolute bg-white p-2 rounded border border-neutral-700 shadow-lg text-neutral-500 z-50`}
9897
>
9998
{this.props.children}

0 commit comments

Comments
 (0)