Skip to content

Commit 5cbe548

Browse files
ivicacclaude
andcommitted
4768 client - Address PR review feedback for date/time clearing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8eeb8ff commit 5cbe548

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

client/src/pages/platform/workflow-editor/components/properties/components/property-input/PropertyInput.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,17 @@ describe('PropertyInput', async () => {
133133
});
134134

135135
it('uses minute precision (step=60) for time inputs so the field is easily clearable', () => {
136-
const {container} = render(<PropertyInput aria-label="Time" label="Time" name="time" type="time" />);
136+
render(<PropertyInput aria-label="Time" label="Time" name="time" type="time" />);
137137

138-
const input = container.querySelector('input[type="time"]');
138+
const input = screen.getByLabelText(/time/i);
139139

140140
expect(input).toHaveAttribute('step', '60');
141141
});
142142

143143
it('keeps step=1 for non-time inputs', () => {
144-
const {container} = render(<PropertyInput aria-label="Date" label="Date" name="date" type="date" />);
144+
render(<PropertyInput aria-label="Date" label="Date" name="date" type="date" />);
145145

146-
const input = container.querySelector('input[type="date"]');
146+
const input = screen.getByLabelText(/date/i);
147147

148148
expect(input).toHaveAttribute('step', '1');
149149
});

client/src/pages/platform/workflow-editor/components/properties/hooks/useProperty.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,10 +569,10 @@ export const useProperty = ({
569569

570570
let resolvedValue: unknown;
571571

572-
if (isNumericalInput) {
573-
resolvedValue = parseFloat(valueToSave as string);
574-
} else if (valueToSave === '' && isDateOrTimeControlType) {
572+
if (valueToSave === '' && (isNumericalInput || isDateOrTimeControlType)) {
575573
resolvedValue = null;
574+
} else if (isNumericalInput) {
575+
resolvedValue = parseFloat(valueToSave as string);
576576
} else {
577577
resolvedValue = valueToSave;
578578
}

0 commit comments

Comments
 (0)