-
Notifications
You must be signed in to change notification settings - Fork 20
Fix: Support for value attribute #438
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
Conversation
|
Hii @armanbilge please review this getting error while compiling after adding value attribute |
armanbilge
left a comment
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.
May I suggest an alternative approach? We can just add a value attribute as a one-off, similar to the style attribute:
calico/calico/src/main/scala/calico/html/Html.scala
Lines 63 to 64 in 9210973
| def styleAttr: HtmlAttr[F, String] = | |
| HtmlAttr("style", encoders.identity) |
|
Yeah thanks for the guidance applying the changes @armanbilge please re-review :) |
|
I can try a snapshot of this but maybe we should have some sort of test with a "real" DOM, just as a regression testing thing |
|
@ansh7432 thanks, can you update the PR description? 😁
Yeah, Calico in general is low on tests ... what do you think is the precise thing that we should test? Really, the main things are does |
|
updated the pr descryption @armanbilge |
|
hmm in that case, maybe it's not needed. Given it's the same code I tried in my hacks, LGTM |
armanbilge
left a comment
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.
thank you!
|
It's my pleasure @kubukoz @armanbilge willing to contribute more |
Missing Support for the
valueAttributeDescription
This PR addresses Issue #428. The problem was that binding a signal to the
defaultValue(orvalue) attribute of progress bars had no effect, preventing them from switching between determinate and indeterminate states as expected.To resolve this, we have added a manual definition for the
valueattribute in our DSL—similar to the definition for thestyleattribute. This ensures that progress bars correctly update their state based on the underlying signal.Reproduction
Below is a full reproduction snippet that demonstrates the issue (with no hacks):
When the signal toggles, the progress bar should switch between having a value (determinate state) and having no value (indeterminate state). However, due to missing support for the native value attribute, this behavior was not working as intended.
Changes Made
Manual value Attribute Definition:
Added a manual definition in the DSL (e.g., in calico/html/Html.scala) as follows:
This ensures that our DSL now has a dedicated valueAttr that correctly maps the value attribute to the native DOM property.