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: formControl add valuePropName support #2461

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

myNameIsDu
Copy link
Member

formControl add valuePropName support

@vercel
Copy link

vercel bot commented Apr 21, 2022

@myNameIsDu is attempting to deploy a commit to the rsuite Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Apr 21, 2022

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

Name Status Preview Updated
rsuite-nextjs ✅ Ready (Inspect) Visit Preview Apr 28, 2022 at 5:04PM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 21, 2022

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.

Latest deployment of this branch, based on commit 22d6f24:

Sandbox Source
rsuite-tp-ci Configuration

@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #2461 (22d6f24) into main (69dee5e) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2461      +/-   ##
==========================================
- Coverage   85.69%   85.68%   -0.01%     
==========================================
  Files         275      275              
  Lines        8666     8668       +2     
  Branches     2438     2439       +1     
==========================================
+ Hits         7426     7427       +1     
  Misses        653      653              
- Partials      587      588       +1     
Flag Coverage Δ
ChromeCi 85.68% <100.00%> (+<0.01%) ⬆️
Firefox 85.67% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/FormControl/FormControl.tsx 93.54% <100.00%> (+0.21%) ⬆️
src/Menu/Menu.tsx 90.00% <0.00%> (-0.67%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69dee5e...22d6f24. Read the comment docs.

@simonguo
Copy link
Member

Hi @myNameIsDu
I'm not quite sure, what problem is it trying to solve?

@myNameIsDu
Copy link
Member Author

Hi @myNameIsDu I'm not quite sure, what problem is it trying to solve?

Here's an example

The value of the Toggle component is actually checked,If I use it in a form, I have to wrap a layer, Others, such as Checkbox Component

@simonguo
Copy link
Member

@myNameIsDu
In use, I think the encapsulation of the Toggle component is easier to understand than the valuePropName prop.

@myNameIsDu
Copy link
Member Author

@myNameIsDu In use, I think the encapsulation of the Toggle component is easier to understand than the valuePropName prop.

Yeah,I think this is a very friendly prop for me,It can help me write lesser template code, And i think if one person knows how to wrap Toggle component, He must understand what this prop is doing

@SevenOutman
Copy link
Member

SevenOutman commented Apr 28, 2022

I don't think a custom value prop is key to this <Toggle> case. We don't take checked from <Toggle> because it receives value via this "customized prop", but because it's a checkbox. The core of resolving this issue is to tell <FormControl> whether its accepter is a radio/checkbox or a normal textbox.

@myNameIsDu
Copy link
Member Author

I don't think a custom value prop is key to this <Toggle> case. We don't take checked from <Toggle> because it receives value via this "customized prop", but because it's a checkbox. The core of resolving this issue is to tell <FormControl> whether its accepter is a radio/checkbox or a normal textbox.

Yeah, if we can handle it internally that's the perfect situation

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.

None yet

3 participants