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
Bug: calcite-radio-button and calcite-radio-group-item issues #1027
Comments
cc: @eriklharper - I think this is the same one we were trying to figure out last week |
This might fix this issue, not completely sure yet |
added 5. |
added 6. |
Issues 2, 4 and 5 seem to be addressed on |
Tested with Test case for #3 and #4, because of this issue I can't get to test #2 anymore. code change (removed workaround)/src/smartMapping/support/Age/index.tsx
Click Styles |
Tested with code change (removed workaround)/src/smartMapping/support/Rotation/index.tsx
Click Styles Sometimes you get the wrong font the first time and sometimes the second time. |
Tested with Test case for #1 . code change (removed workaround of event.stopPropagation())/src/smartMapping/Size/index.tsx
Click Styles |
Issue #1027 (comment) fixed by #1056 and requires code modification outlined in issue #1041 |
2,3,5 verified with |
Does verified mean resolved? |
yes, all good now with the new 4 is still reproducible for me. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This can be closed as the items have all been addressed in separate issues. |
Summary
In both cases I have 2 buttons or group-items. I only listen to the change event handler of the first button or group-item and enter different async workflows depending if event.target.checked is true or false.
Note: all these issues go away if I use event.stopPropagation() and listen to the change event for both buttons and group-items and only act if checked is true. Also, I need to add name, scale, span to radio-buttons.
Issues 1. and 2. must have started after beta.37, which is what we use in MVB on production.
I mostly tested with beta.40 and next.9 from today with a test app outside of MVB, but with using Maquette.
calcite-radio-group-item
(moved to Bug: calcite-radio-group-item change event firing too many times #1058)I seem to have to call event.stopPropagation() in the change event handler, otherwise the change event gets called 3 times in a row with different event.target.checked settings after the component gets recreated in Marquette in the afterCreate property. I verified, via a timestamp, that the event handler that is called 3 times is the one that was created last by afterCreate. No event handler left-overs from the original creation of the component. Maybe this has something to do with the clean-up not working correctly.
True/false is the checked state, the last 3 change event calls come from a single click.
calcite-radio-button
This only happens if I start with the second button checked, the one that doesn't listen to the change event. After the second toggle it gets in the state that both radio buttons are checked. I noticed that in this case it does not call the un-check change event on the first button.
-> this is expected now, no more change event on un-check; double check is fixed
3.
calcite-radio-button
This is new with next.9, didn't happen with beta.40. It no longer calls the change event for a radio button that gets un-checked.
-> it seems this is purpose now
4.
calcite-radio-button
When removing my component I see this.
Might be related to this Bug: calcite-radio-button: destroying throws errors #977
calcite-radio-button
Tested with next.9. Kevin mentioned to add
name
andscale
to calcite-radio-button and add the label inside aspan
element.Without it this is what I see: Size/font is messed up the second time the radio buttons load because the text is not wrapped in calcite-label.
first time
second time
Do we need to update the doc and mention the span?
calcite-radio-button
When I add text for a radio-button like
<calcite-radio-button>{text}</calcite-radio-button>
the text is wrapped inside a calcite-label component. This is fine. When I use it this way in my code<calcite-radio-button>{text1}{text2}</calcite-radio-button>
then text1 and text2 are each wrapped in a calcite-label, not together in a single calcite-label. Is this ok? When I do this<calcite-radio-button>{`${text1}${text2}`}</calcite-radio-button>
it's just one calcite-label. Resolved by fix(calcite-radio-button): all children text nodes render inside a single calcite-label #1195Not sure if any of this makes sense, but I don't quite understand what's going on exactly behind the scene.
Also, it might be related to it being used with Maquette. Timing seems to be a bit different there.
Actual Behavior
Expected Behavior
Reproduction Steps
Relevant Info
The text was updated successfully, but these errors were encountered: