File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -737,8 +737,9 @@ var Idiomorph = (function () {
737737 }
738738 if ( newLiveValue ) {
739739 if ( ! ignoreUpdate ) {
740- // TODO: do we really want this? tests say so but it feels wrong
741- oldElement . setAttribute ( attributeName , newLiveValue ) ;
740+ // https://developer.mozilla.org/en-US/docs/Glossary/Boolean/HTML
741+ // this is the correct way to set a boolean attribute to "true"
742+ oldElement . setAttribute ( attributeName , '' ) ;
742743 }
743744 } else {
744745 if ( ! ignoreAttribute ( attributeName , oldElement , "remove" , ctx ) ) {
Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ describe("Core morphing tests", function () {
427427
428428 let finalSrc = '<input type="checkbox" checked>' ;
429429 Idiomorph . morph ( initial , finalSrc , { morphStyle : "outerHTML" } ) ;
430- initial . outerHTML . should . equal ( '<input type="checkbox" checked="true ">' ) ;
430+ initial . outerHTML . should . equal ( '<input type="checkbox" checked="">' ) ;
431431 initial . checked . should . equal ( true ) ;
432432 document . body . removeChild ( parent ) ;
433433 } ) ;
@@ -474,7 +474,7 @@ describe("Core morphing tests", function () {
474474 // is this a problem at all?
475475 parent . innerHTML . should . equal ( `
476476 <select>
477- <option selected="true ">0</option>
477+ <option selected="">0</option>
478478 <option>1</option>
479479 </select>
480480 ` ) ;
@@ -506,7 +506,7 @@ describe("Core morphing tests", function () {
506506 let finalSrc = `
507507 <select>
508508 <option>0</option>
509- <option selected="true ">1</option>
509+ <option selected="">1</option>
510510 </select>
511511 ` ;
512512 Idiomorph . morph ( parent , finalSrc , { morphStyle : "innerHTML" } ) ;
You can’t perform that action at this time.
0 commit comments