Skip to content

Commit

Permalink
Merge branch 'main' into 191-well-completion-module
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgenherje committed Aug 29, 2023
2 parents c4daff9 + 3f3d5b7 commit ed0c91c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
33 changes: 17 additions & 16 deletions frontend/src/lib/components/Input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,28 @@ export const Input = React.forwardRef((props: InputProps, ref: React.ForwardedRe

const handleInputChange = React.useCallback(
(event: React.ChangeEvent<HTMLInputElement>) => {
let value = parseFloat(event.target.value);
if (props.min !== undefined) {
value = Math.max(props.min, value);
if (props.type === "number") {
let newValue = parseFloat(event.target.value || "0");
if (props.min !== undefined) {
newValue = Math.max(props.min, newValue);
}

if (props.max !== undefined) {
newValue = Math.min(props.max, newValue);
}

if (newValue !== prevValue) {
setValue(newValue);
setPrevValue(newValue);
}

event.target.value = newValue.toString();
}

if (props.max !== undefined) {
value = Math.min(props.max, value);
}

if (value !== prevValue) {
setValue(value);
setPrevValue(value);
}

event.target.value = value.toString();

if (onChange) {
onChange(event);
}
},
[props.min, props.max, onChange]
[props.min, props.max, onChange, props.type, prevValue]
);

return (
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/lib/components/SmartNodeSelector/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
export { SmartNodeSelector, SmartNodeSelectorComponent, KeyEventType, Direction } from "./smartNodeSelector";
export { TreeNodeSelection } from "./private-utils/treeNodeSelection";
export { TreeData, MatchType } from "./private-utils/treeData";
export type { SmartNodeSelectorProps, SmartNodeSelectorComponentProps } from "./smartNodeSelector";
export type {
SmartNodeSelectorSelection,
SmartNodeSelectorProps,
SmartNodeSelectorComponentProps,
} from "./smartNodeSelector";
export type { TreeDataNode } from "./private-utils/treeDataNodeTypes";
4 changes: 2 additions & 2 deletions radixconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
envVar: WEBVIZ_CLIENT_SECRET
- name: WEBVIZ-SMDA-RESOURCE-SCOPE
envVar: WEBVIZ_SMDA_RESOURCE_SCOPE
- name: WEBVIZ-SMDA-SUBSCRIPTION_KEY
- name: WEBVIZ-SMDA-SUBSCRIPTION-KEY
envVar: WEBVIZ_SMDA_SUBSCRIPTION_KEY
variables:
UVICORN_PORT: 5000
Expand All @@ -57,7 +57,7 @@ spec:
envVar: WEBVIZ_CLIENT_SECRET
- name: WEBVIZ-SMDA-RESOURCE-SCOPE
envVar: WEBVIZ_SMDA_RESOURCE_SCOPE
- name: WEBVIZ-SMDA-SUBSCRIPTION_KEY
- name: WEBVIZ-SMDA-SUBSCRIPTION-KEY
envVar: WEBVIZ_SMDA_SUBSCRIPTION_KEY
variables:
UVICORN_PORT: 8000
Expand Down

0 comments on commit ed0c91c

Please sign in to comment.