-
-
Notifications
You must be signed in to change notification settings - Fork 997
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(module: Select) bind value change lock, tags and labels fix, overlay reposition #1191
fix(module: Select) bind value change lock, tags and labels fix, overlay reposition #1191
Conversation
fix for exception when label is a property with getter only
Codecov Report
@@ Coverage Diff @@
## master #1191 +/- ##
=========================================
- Coverage 6.38% 6.36% -0.02%
=========================================
Files 439 439
Lines 25074 25141 +67
=========================================
Hits 1600 1600
- Misses 23474 23541 +67
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
…rlay reposition (ant-design-blazor#1191) * fix(module:select) _setLabel not needed for non-tags fix for exception when label is a property with getter only * fix(module:select): bind-Value lock if changed outside component * fix(module:Select): overlay reposition SelectContent resize
…rlay reposition (#1191) * fix(module:select) _setLabel not needed for non-tags fix for exception when label is a property with getter only * fix(module:select): bind-Value lock if changed outside component * fix(module:Select): overlay reposition SelectContent resize
…rlay reposition (#1191) * fix(module:select) _setLabel not needed for non-tags fix for exception when label is a property with getter only * fix(module:select): bind-Value lock if changed outside component * fix(module:Select): overlay reposition SelectContent resize
🤔 This is a ...
🔗 Related issue link
Fixes #1171
💡 Background and solution
Commit 25c3dcb
During my tests, it came out that if I had a class that the label was attached to a property that it had only a getter, then
Select
was crashing. The source of problems was the PR #1168. The_setLabel
was prepared regardless of the type of select. The property that is attached to label needs to have a setter only forSelectMode.Tags
.Commit d4e2966
Several fixes to solve #1171. The result it this:
7c7d481
Update of the overlay position was not really effective, as it was doing its updates before all the relevant changes were pushed to DOM. Adding
Task.Delay(1)
solved this issue. I am not really happy with it. The other option would be maybe to use ResizeObserver but there might be a problem with browser compatibility.Other condierations:
All operations done in mehtods
EvaluateValueChangedOutsideComponent
andEvaluateValuesChangedOutsideComponent
are basically needed only whenValue
andValues
are changed outside of the component. I imagine this is going to be a much less often scenario in comparison to when they are changed by the component. At this stage, when values are changed by the component, the aforementioned methods are not necessary. This is mostly a performance issue when dealing with multiple/tags mode. But it probably would be beneficial to have some kind of a way to generate a hash or some other way to be able to compare if values were changed internally or externally. If external change is detected, then run the evaluation methods.📝 Changelog
☑️ Self Check before Merge