Skip to content

#28/integer values in select and radio components - #37

Merged
hellcp merged 1 commit into
pebble-dev:mainfrom
merlin1991:#28/integer_values_in_select_radio
Aug 3, 2026
Merged

#28/integer values in select and radio components#37
hellcp merged 1 commit into
pebble-dev:mainfrom
merlin1991:#28/integer_values_in_select_radio

Conversation

@merlin1991

@merlin1991 merlin1991 commented Jul 31, 2026

Copy link
Copy Markdown

Fixes #28

V2:

I introduced the option serializeValueAs for input, select, and radiogroup components defaulting to 'string'.
If the option is set to 'integer' values are converted with Math.trunc(Number.parseInt(value, 10)) with a fallback of 0 for NaN.

@merlin1991
merlin1991 force-pushed the #28/integer_values_in_select_radio branch from ac7c26b to 7d5c502 Compare July 31, 2026 21:27
@hellcp

hellcp commented Aug 1, 2026

Copy link
Copy Markdown
Member

I feel like the "sometimes a string, sometimes an int" is a little weird to handle in C. Also, this lacks flexibility without an option to also have float values.

@merlin1991
merlin1991 force-pushed the #28/integer_values_in_select_radio branch from 7d5c502 to 6a0dac6 Compare August 2, 2026 20:54
@merlin1991
merlin1991 force-pushed the #28/integer_values_in_select_radio branch from 6a0dac6 to 511e46e Compare August 2, 2026 20:58
@hellcp
hellcp merged commit 3386e60 into pebble-dev:main Aug 3, 2026
4 checks passed
@merlin1991
merlin1991 deleted the #28/integer_values_in_select_radio branch August 3, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow integer values in select and radio Components

2 participants