Skip to content
Snippets Groups Projects
Commit dd34d515 authored by Leonardo's avatar Leonardo
Browse files

fix: dropdown autocomplete needs to allow enter key

parent a44bd1a3
No related branches found
No related tags found
No related merge requests found
Pipeline #145874 passed with warnings
......@@ -94,6 +94,17 @@ export const DropdownInput = ({
setFilteredOptions(newFilteredOptions);
};
function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {
if (e.key === 'Enter') {
if (onChange) {
onChange(filterInput as string);
}
if (onKeyDown) {
onKeyDown(e);
}
}
}
if (!tooltip && inline) tooltip = label;
return (
......@@ -128,7 +139,7 @@ export const DropdownInput = ({
{overrideRender ? (
overrideRender
) : autocomplete ? (
<AutocompleteRenderer onChange={handleInputChange} value={filterInput as string} onKeyDown={onKeyDown} />
<AutocompleteRenderer onChange={handleInputChange} value={filterInput as string} onKeyDown={handleKeyDown} />
) : null}
</DropdownTrigger>
{isDropdownOpen && (
......
......@@ -130,7 +130,9 @@ export function QueryLogicPill(node: SchemaReactflowLogicNode) {
setLocalInputCache({ ...localInputCache, [input.name]: value });
if (execute) onInputUpdated(value, input, i);
}}
onExecute={() => onInputUpdated(localInputCache?.[input.name] as string, input, i)}
onExecute={() => {
onInputUpdated(localInputCache?.[input.name] as string, input, i);
}}
/>
) : (
<span className="px-1 m-0 mx-1 p-0 h-5 w-full rounded-sm border-[1px]">
......
......@@ -180,7 +180,7 @@ const Vis0DSettings = ({ settings, graphMetadata, updateSettings }: Visualizatio
settings.selectedEntity != null &&
settings.selectedAttribute &&
statsOptions.length == 0 &&
graphMetadata.nodes.types[settings.selectedEntity].attributes[settings.selectedAttribute] != null
graphMetadata.nodes?.types?.[settings.selectedEntity]?.attributes?.[settings.selectedAttribute] != null
) {
const attributeSelectedStatistics =
graphMetadata.nodes.types[settings.selectedEntity].attributes[settings.selectedAttribute].statistics;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment