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

fix(web-components): add current-value attribute to TextInput component #33144

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

radium-v
Copy link
Contributor

New Behavior

Adds the current-value attribute and currentValue property to the <fluent-text-input> element.

Related Issue(s)

@radium-v radium-v requested a review from a team as a code owner October 26, 2024 00:04
@fabricteam
Copy link
Collaborator

📊 Bundle size report

✅ No changes found

@marchbox
Copy link
Contributor

Could you elaborate a bit on why we need current-value and how that fixes the bug? Just wanted to make sure we have somewhere to reference back to if similar issue occurs again in the future.

@radium-v
Copy link
Contributor Author

@marchbox for inputs, binding to the value attribute isn't possible since value attribute represents the component's initial/default value, not its current value. Changing the value attribute after a user has interacted with it has no effect on the current value.

Some systems, like Blazor, use attribute bindings to sync states between the client and the server. Providing a current-value attribute that can be tied directly to the value property is a convenience when the alternative would require extra layers of complexity.

(The current-value attribute is something we supported on Foundation controls for this same reason, via the now unused FormAssociated class mixin.)

Copy link

github-actions bot commented Nov 27, 2024

📊 Bundle size report

✅ No changes found

Copy link

Pull request demo site: URL

@fabricteam
Copy link
Collaborator

🕵 fluentui-web-components-v3 No visual regressions between this PR and main

@radium-v radium-v merged commit df2eb61 into microsoft:master Dec 5, 2024
16 checks passed
@radium-v radium-v deleted the text-input-value branch December 5, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug]: fluent-text-input - The second update is not displayed
4 participants