diff --git a/src/relations/Bounds.js b/src/relations/Bounds.js index 3ebae4b..9f09d9a 100644 --- a/src/relations/Bounds.js +++ b/src/relations/Bounds.js @@ -93,13 +93,14 @@ const mergeBounds = clientBounds => { }; const extend = function(a, b) { + const { bottom, height, top } = a; + const x = Math.min(a.x, b.x); const left = Math.min(a.left, b.left); const y = Math.max(a.y, b.y); const right = Math.max(a.right, b.right); const width = a.width + b.width; - const { bottom, height, top } = a; return { bottom, height, left, right, top, width, x, y }; }; diff --git a/src/relations/editor/RelationAutocomplete.js b/src/relations/editor/RelationAutocomplete.js index 5165037..30ecc84 100644 --- a/src/relations/editor/RelationAutocomplete.js +++ b/src/relations/editor/RelationAutocomplete.js @@ -26,11 +26,17 @@ const RelationAutocomplete = props => { getItemProps, } = useCombobox({ items: inputItems, onInputValueChange }); + const onKeyDown = evt => { + // Only forward key events if the dropdown is closed, or no option selected) + if (!isOpen || highlightedIndex == -1) + props.onKeyDown(evt); + } + return (