Behavior + style bugfixes
This commit is contained in:
parent
779629ed2f
commit
e6e33158ab
|
@ -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 };
|
||||
};
|
||||
|
||||
|
|
|
@ -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 (
|
||||
<div ref={element}>
|
||||
<div {...getComboboxProps()}>
|
||||
<input
|
||||
{...getInputProps({ onKeyDown: evt => { if (!isOpen) props.onKeyDown(evt); } })}
|
||||
{...getInputProps({ onKeyDown })}
|
||||
placeholder={props.placeholder}
|
||||
value={props.content} />
|
||||
</div>
|
||||
|
|
|
@ -57,6 +57,10 @@
|
|||
box-shadow:0 0 20px rgba(0,0,0,0.25);
|
||||
}
|
||||
|
||||
ul:empty {
|
||||
display:none;
|
||||
}
|
||||
|
||||
li {
|
||||
box-sizing:border-box;
|
||||
padding:2px 12px;
|
||||
|
|
Loading…
Reference in New Issue