-
Notifications
You must be signed in to change notification settings - Fork 372
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
Not setting current-value
for fluent-number-field
#1424
Conversation
@microsoft-github-policy-service agree |
I agree with you that this is a bug we need to fix. But I don't think we need to remove For example, using this simple HTML code using the Web Component (same for <html>
<head>
<script type="module" src="https://unpkg.com/@fluentui/web-components"></script>
</head>
<form action="" method="get">
<input name="myOne" checked value="1" current-value="2" type="checkbox">One
<fluent-checkbox name="myTwo" value="3" current-value="4">Two</fluent-checkbox>
<button type="submit">Save</button>
</form>
</html> |
Oh, I didn't know that. Yes, you're right. fluentui-blazor/src/Core/Components/Base/FluentInputBase.cs Lines 166 to 173 in ed2a3c8
Right now, can't make a fluent-switch with different I think can remove If it's okay, I'll undo the changes to fluent-switch and change the PR title. |
I've done some more check and looked at it with @dvoituron. I removed the code that put both |
41a87a5
to
97dbde9
Compare
current-value
for fluent-switch and fluent-number-fieldcurrent-value
for fluent-number-field
Pull Request
📖 Description
In Blazor Server, holding down
Space
,ArrowUp
, orArrowDown
leads to a loop in value changes.This issue has been reproduced in both the dev branch and v4.3.1.
Both fluent-switch and fluent-number-field have
value
andcurrent-value
properties.The difference between them is that
current-value
represents the real-time value displayed in the UI.This means that
current-value
andvalue
can differ, especially with rapid inputs.Since setting either
current-value
orvalue
triggers a change in value, under certain conditions, this can cause a loop in value changes.This PR resolves the issue by not setting
current-value
.🎫 Issues
👩💻 Reviewer Notes
There are other components that set
current-value
andvalue
, but since the bug could not be reproduced with them, they were not included in the commit.📑 Test Plan
✅ Checklist
General
Component-specific
⏭ Next Steps