Skip to content

Part start and end setters receive strings from OptionTextField #272

Open

Description

@jtklein-agents

Found while typing the partition editor (#250).

PartStart and PartEnd (src/app/store/PartOptions.ts) are Option<number>, so setValue takes a number. The partition editor renders them with OptionTextField, which calls option.setValue( event.target.value ) with a string. Option.setValue converts a valid string to a number through the yup number schema. An invalid string (for example abc, or an empty field) is stored unchanged in the number-typed value.

#250 handles this without changing runtime behaviour. The editor's module-local PartPositionOption widens setValue to ( value: string | number ) => void.

To fix: either give OptionTextField a numeric path that parses before calling setValue, or type the part position options to take the raw string and convert it in the store. Then remove the widened setter from src/app/PartitionEditor.tsx.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions