File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -74,9 +74,11 @@ class Pattern extends BasePattern {
74
74
}
75
75
76
76
enable ( ) {
77
- if ( dom . is_input ( this . el ) ) {
78
- this . el . disabled = false ;
79
- } else if ( this . el . tagName === "A" ) {
77
+ const inputs = dom . find_inputs ( this . el ) ;
78
+ for ( const input of inputs ) {
79
+ input . disabled = false ;
80
+ }
81
+ if ( this . el . tagName === "A" ) {
80
82
events . remove_event_listener ( this . el , "pat-depends--click" ) ;
81
83
}
82
84
this . el . classList . remove ( "disabled" ) ;
@@ -89,9 +91,11 @@ class Pattern extends BasePattern {
89
91
}
90
92
91
93
disable ( ) {
92
- if ( dom . is_input ( this . el ) ) {
93
- this . el . disabled = true ;
94
- } else if ( this . el . tagName === "A" ) {
94
+ const inputs = dom . find_inputs ( this . el ) ;
95
+ for ( const input of inputs ) {
96
+ input . disabled = true ;
97
+ }
98
+ if ( this . el . tagName === "A" ) {
95
99
events . add_event_listener ( this . el , "click" , "pat-depends--click" , ( e ) =>
96
100
e . preventDefault ( )
97
101
) ;
You can’t perform that action at this time.
0 commit comments