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

feat(forms): add Form.FieldProps provider to forward a certain props to all fields #3536

Merged
merged 2 commits into from
May 8, 2024

Conversation

tujoworker
Copy link
Member

No description provided.

@tujoworker tujoworker requested a review from joakbjerk May 8, 2024 06:49
Copy link

vercel bot commented May 8, 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 May 8, 2024 7:07am

Copy link

codesandbox-ci bot commented May 8, 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.

@@ -0,0 +1,26 @@
---
title: 'FieldProps'
description: '`Form.FieldProps` is a provider for forwarding fields properties, such as `required` or `disabld` to all nested field components.'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: '`Form.FieldProps` is a provider for forwarding fields properties, such as `required` or `disabld` to all nested field components.'
description: '`Form.FieldProps` is a provider for forwarding field properties, such as `required` or `disabld` to all nested field components.'


## Description

`Form.FieldProps` is a provider for forwarding fields properties, such as `required` or `disabld` to all nested field components.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`Form.FieldProps` is a provider for forwarding fields properties, such as `required` or `disabld` to all nested field components.
`Form.FieldProps` is a provider for forwarding field properties, such as `required` or `disabld` to all nested field components.

const context = reduceContext(contexts)
return Object.entries(context).reduce((acc, [key, value]) => {
if (!(props && Object.prototype.hasOwnProperty.call(props, key))) {
// if (key !== 'disabled') {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably remove these comments?

@tujoworker tujoworker merged commit 0f875bd into main May 8, 2024
10 checks passed
@tujoworker tujoworker deleted the feat/field-props branch May 8, 2024 07:38
tujoworker pushed a commit that referenced this pull request May 8, 2024
## [10.30.0](v10.29.0...v10.30.0) (2024-05-08)

### 🐛 Bug Fixes

* **Eufemia:** enhance CSS version check for dnb-core-style ([#3522](#3522)) ([eac2bcf](eac2bcf))

### ✨ Features

* **forms:** add `fieldPropsWhenHidden` to Visibility ([#3539](#3539)) ([5d8d6db](5d8d6db))
* **forms:** add `Form.FieldProps` provider to forward a certain props to all fields ([#3536](#3536)) ([0f875bd](0f875bd))
* **forms:** add `locale`, `translations`, `required` and `disabled` prop support to `Form.Handler` ([#3537](#3537)) ([b95f215](b95f215))
@tujoworker
Copy link
Member Author

🎉 This PR is included in version 10.30.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.

None yet

2 participants