File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
core/src/components/textarea Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,9 @@ export class Textarea implements ComponentInterface {
149149 */
150150 @Prop ( ) disabled = false ;
151151
152+ /**
153+ * Update element internals when disabled prop changes
154+ */
152155 @Watch ( 'disabled' )
153156 protected disabledChanged ( ) {
154157 this . updateElementInternals ( ) ;
@@ -310,7 +313,7 @@ export class Textarea implements ComponentInterface {
310313 }
311314
312315 /**
313- * Update validation state when required prop changes
316+ * Update native input and element internals when required prop changes
314317 */
315318 @Watch ( 'required' )
316319 protected requiredChanged ( ) {
@@ -599,7 +602,11 @@ export class Textarea implements ComponentInterface {
599602 // Disabled form controls should not be included in form data
600603 // Pass null to setFormValue when disabled to exclude it from form submission
601604 const value = this . disabled ? null : this . getValue ( ) ;
602- this . internals . setFormValue ( value ) ;
605+ // ElementInternals may not be fully available in test environments
606+ // so we need to check if the method exists before calling it
607+ if ( typeof this . internals . setFormValue === 'function' ) {
608+ this . internals . setFormValue ( value ) ;
609+ }
603610 reportValidityToElementInternals ( this . nativeInput , this . internals ) ;
604611 }
605612
You can’t perform that action at this time.
0 commit comments