File tree Expand file tree Collapse file tree 5 files changed +13
-7
lines changed
tests/validator/samples/contenteditable-dynamic Expand file tree Collapse file tree 5 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " svelte " : patch
3+ ---
4+
5+ fix: allow boolean ` contenteditable ` attribute
Original file line number Diff line number Diff line change @@ -371,10 +371,6 @@ const errors = {
371371 // message:
372372 // "'contenteditable' attribute is required for textContent, innerHTML and innerText two-way bindings"
373373 // },
374- // dynamic_contenteditable_attribute: {
375- // code: 'dynamic-contenteditable-attribute',
376- // message: "'contenteditable' attribute cannot be dynamic if element uses two-way binding"
377- // },
378374 // textarea_duplicate_value: {
379375 // code: 'textarea-duplicate-value',
380376 // message:
Original file line number Diff line number Diff line change @@ -475,7 +475,7 @@ const validation = {
475475 ) ;
476476 if ( ! contenteditable ) {
477477 error ( node , 'missing-contenteditable-attribute' ) ;
478- } else if ( ! is_text_attribute ( contenteditable ) ) {
478+ } else if ( ! is_text_attribute ( contenteditable ) && contenteditable . value !== true ) {
479479 error ( contenteditable , 'dynamic-contenteditable-attribute' ) ;
480480 }
481481 }
Original file line number Diff line number Diff line change 33 "code" : " dynamic-contenteditable-attribute" ,
44 "message" : " 'contenteditable' attribute cannot be dynamic if element uses two-way binding" ,
55 "start" : {
6- "line" : 6 ,
6+ "line" : 11 ,
77 "column" : 8
88 },
99 "end" : {
10- "line" : 6 ,
10+ "line" : 11 ,
1111 "column" : 32
1212 }
1313 }
Original file line number Diff line number Diff line change 33
44 let toggle = false ;
55 </script >
6+ <!-- ok -->
7+ <editor contenteditable ="true" bind:innerHTML ={name }></editor >
8+ <editor contenteditable ="" bind:innerHTML ={name }></editor >
9+ <editor contenteditable bind:innerHTML ={name }></editor >
10+ <!-- error -->
611<editor contenteditable ={toggle } bind:innerHTML ={name }></editor >
You can’t perform that action at this time.
0 commit comments