Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(Selection): value should be string when variant is radio or button #3869

Merged

Conversation

langz
Copy link
Contributor

@langz langz commented Aug 26, 2024

Motivation:
The value property of Field.Selection states the type is string and number, however when using variant radio or button with a value of type number it breaks.

Reason it breaks, is because the value property of RadioButton and ToggleButton states it only supports string.

Any better ways to fix/improve on this, rather than just adding a description to the docs? 🤔

Copy link

vercel bot commented Aug 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eufemia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 0:04am

@langz langz requested review from tujoworker and joakbjerk August 26, 2024 11:48
Copy link

codesandbox-ci bot commented Aug 26, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@joakbjerk
Copy link
Contributor

I think we maybe could do some TypeScript magic here, but can't come up with a good example on the go right now 😅

@langz
Copy link
Contributor Author

langz commented Aug 26, 2024

I think we maybe could do some TypeScript magic here, but can't come up with a good example on the go right now 😅

Yeah, I agree, but if I remember correct. The last time I looked into this, the TypeScript Magic results in code that's very difficult to read. So decided against it.

Copy link
Member

@tujoworker tujoworker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👏

@langz langz merged commit aab8f5b into main Aug 27, 2024
10 checks passed
@langz langz deleted the docs/improve-docs-for-value-of-field-selection-radio-button branch August 27, 2024 19:43
tujoworker pushed a commit that referenced this pull request Sep 2, 2024
## [10.46.0](v10.45.0...v10.46.0) (2024-09-02)

### 📝 Documentation

* **Selection:** value should be string when variant is radio or button ([#3869](#3869)) ([aab8f5b](aab8f5b))

### ✨ Features

* **Blocks.ChildrenWithAge:** removes step controls in age field ([#3867](#3867)) ([3b02e45](3b02e45))
* **CopyOnClick:** add new component ([#3834](#3834)) ([07ba09d](07ba09d))
* **Field.ArraySelection:** add dataPath prop ([#3872](#3872)) ([35427d7](35427d7))
* **Forms:** add `Value.SelectCountry` component ([#3875](#3875)) ([416df35](416df35))
* **Forms:** add function support for the `prefix` or `suffix` props in `Field.Number` ([#3880](#3880)) ([652448c](652448c))
* **Forms:** add validation for dnr and fnr in `Field.NationalIdentityNumber` ([#3771](#3771)) ([8a2da43](8a2da43))
* **Forms:** deprecate filterSubmitData in Form.Handler and return `filterData` in onSubmit and onChange instead ([#3873](#3873)) ([f05bdd2](f05bdd2))

### 🐛 Bug Fixes

* **Forms:** add support for `gap={false}` to Value.Composition (ValueBlock) ([#3884](#3884)) ([413c568](413c568))
* **Forms:** enhance `Field.Email` validation pattern ([#3874](#3874)) ([aee005f](aee005f))
* **Forms:** fallback to use default locale for translations when providing a non-existent locale ([#3817](#3817)) ([f768613](f768613))
* **InfinityScroller:** forward load button props ([#3737](#3737)) ([645a7b3](645a7b3))
@tujoworker
Copy link
Member

🎉 This PR is included in version 10.46.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants