Skip to content

Commit

Permalink
CB-5092 fix: selectors and nodes context menu do not break layout for…
Browse files Browse the repository at this point in the history
… small screens
  • Loading branch information
sergeyteleshev committed May 20, 2024
1 parent 9eaf013 commit 7083d4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 2 additions & 6 deletions webapp/packages/core-blocks/src/FormControls/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const Combobox: ComboboxType = observer(function Combobox({
placement: 'bottom-end',
currentId: null,
gutter: 4,
unstable_fixed: true,
});

if (readOnly) {
Expand Down Expand Up @@ -150,11 +151,6 @@ export const Combobox: ComboboxType = observer(function Combobox({
}
}

function handleArrowClick(e: React.MouseEvent) {
e.preventDefault();
handleClick();
}

const handleChange = useCallback(
(event: React.ChangeEvent<HTMLInputElement>) => {
const value = event.target.value;
Expand Down Expand Up @@ -303,7 +299,7 @@ export const Combobox: ComboboxType = observer(function Combobox({
onClick={handleClick}
{...rest}
/>
<MenuButton {...menu} disabled={readOnly || disabled || hideMenu} className={styles.menuButton} onClick={handleArrowClick}>
<MenuButton {...menu} disabled={readOnly || disabled || hideMenu} className={styles.menuButton}>
<Icon name="arrow" viewBox="0 0 16 16" className={s(styles, { icon: true, focus })} />
</MenuButton>
<Menu {...menu} ref={menuRef} aria-label={propertyName} className={s(styles, { menu: true })} modal>
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-blocks/src/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const Menu = observer<IMenuProps, HTMLButtonElement>(
placement,
visible,
rtl,
unstable_fixed: true,
});
const styles = useS(style);

Expand Down

0 comments on commit 7083d4e

Please sign in to comment.