File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed
tests/runtime-legacy/samples/attribute-boolean-inert Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' svelte ' : patch
3+ ---
4+
5+ fix: treat ` inert ` as a boolean attribute
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ const DOM_BOOLEAN_ATTRIBUTES = [
156156 'formnovalidate' ,
157157 'hidden' ,
158158 'indeterminate' ,
159+ 'inert' ,
159160 'ismap' ,
160161 'loop' ,
161162 'multiple' ,
@@ -214,7 +215,6 @@ const DOM_PROPERTIES = [
214215 'playsInline' ,
215216 'readOnly' ,
216217 'value' ,
217- 'inert' ,
218218 'volume' ,
219219 'defaultValue' ,
220220 'defaultChecked' ,
Original file line number Diff line number Diff line change 1- import { ok , test } from '../../test' ;
1+ import { test } from '../../test' ;
22
33export default test ( {
4+ ssrHtml : `
5+ <div></div>
6+ <div inert="">some div <button>click</button></div>
7+ ` ,
8+
49 get props ( ) {
510 return { inert : true } ;
611 } ,
12+
713 test ( { assert, target, component } ) {
8- const div = target . querySelector ( 'div' ) ;
9- ok ( div ) ;
10- assert . ok ( div . inert ) ;
14+ const [ div1 , div2 ] = target . querySelectorAll ( 'div' ) ;
15+ assert . ok ( ! div1 . inert ) ;
16+ assert . ok ( div2 . inert ) ;
17+
1118 component . inert = false ;
12- assert . ok ( ! div . inert ) ;
19+ assert . ok ( ! div2 . inert ) ;
1320 }
1421} ) ;
Original file line number Diff line number Diff line change 22export let inert;
33 </script >
44
5+ <div inert ={false }></div >
56<div {inert }>some div <button >click</button ></div >
You can’t perform that action at this time.
0 commit comments