Repository navigation
Bound boolean isn't set from true to false when radio button is unchecked #291
Description
Activity
Functionality of input type radio came up before and led to us making an example that works with polymer-selector. It's available at the bottom of the example file here: https://github.com/Polymer/polymer-elements/blob/master/polymer-selector/index.html
@sethladd and I also came up with http://jsbin.com/iXuSOCO/2/edit as a raw radio button solution.
Thanks guys, those are good workarounds. I was hoping that this bug report is a fine-grained and distilled repro of what is possibly indicative of a bug.
Does HTML fire a changed event when a radio button goes from true to false? I'll need to investigate.
Re: the change event, I don't think so.
I'll let @rafaelw weigh in on supporting this better in Node.bind.
On Sep 24, 2013, at 6:11 PM, Seth Ladd notifications@github.com wrote:
Thanks guys, those are good workarounds. I was hoping that this bug report
is a fine-grained and distilled repro of what is possibly indicative of a
bug.Does HTML fire a changed event when a radio button goes from true to false?
I'll need to investigate.—
Reply to this email directly or view it on
GitHubhttps://github.com//issues/291#issuecomment-25055626
.Some observations...
I think it's NodeBind.js getAssociatedRadioButtons() that prevents the radio button from being checked because:
element.ownerDocument.contains(element))returns false, causeelement(the input) is in the Shadow DOM and the polyfillcontains()isn't smart enough to look there... possible fix & test- If # 1 was fixed and if the radio buttons were wrapped in a form, you'd blow up here because
HTMLFormElement.elementsdoes notwrapit's items... possible fix & test - If # 1 was fixed and the radio buttons weren't wrapped in a form (just like the examples above), still broken cause
ownerDocument.querySelectorAll()won't find the inputs in the ShadowDOM... Should it look inside the shadowRoot instead?
Hope this helps.
Thanks Peter. Someone on the list brought up the getAssociatedRadioButtons diagnosis as well.
Yup. getAssociatedRadioButtons needed to be tolerant of associated radio buttons within a ShadowRoot.
Fixed here: googlearchive/NodeBind@9978535
Very cool, thanks Raf!
Going from false to true sets the bound boolean, but going from true to false does not set the bound boolean back to false.
Here's the test:
/cc @ebidel