File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/react/test/base/tests/e2e/specs/components Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,13 @@ describe('Inputs', () => {
7878 cy . get ( 'ion-input input' ) . focus ( ) . blur ( ) ;
7979 cy . get ( 'ion-input' ) . should ( 'have.class' , 'ion-invalid' ) ;
8080
81- cy . get ( 'ion-textarea' ) . shadow ( ) . find ( 'textarea' ) . focus ( ) . blur ( ) ;
81+ // Use cy.focused().blur() instead of directly targeting ion-textarea or
82+ // the native textarea element because:
83+ // React 17/18 moves focus to the ion-textarea component
84+ // React 19 moves focus to the native textarea element
85+ // cy.focused() adapts to whichever element is actually focused
86+ cy . get ( 'ion-textarea' ) . shadow ( ) . find ( 'textarea' ) . focus ( ) ;
87+ cy . focused ( ) . blur ( ) ;
8288 cy . get ( 'ion-textarea' ) . should ( 'have.class' , 'ion-invalid' ) ;
8389 } ) ;
8490
You can’t perform that action at this time.
0 commit comments