Description
Description:
After updating from 18.0.0 to 18.0.2 many of our Cypress tests started failing. These are tests that close a modal and then immediately starts typing in input fields. Standard behaviour seems to be that page focus returns to the button that opened the modal after it is closed, but in 18.0.2 this is happening some time later than before. This results in some Cypress tests failing because the input field being typed in loses focus.
We've tried waiting for the modal to disappear from the DOM before continuing the tests with:
cy.get('bs-modal-backdrop').should('not.exist');
cy.get('modal-container').should('not.exist');
cy.get('body').should('not.have.class', 'modal-open');
but none of these delay the tests long enough for the modal opening button to be focussed before continuing. We also tried waiting for the button to be focussed before continuing, but it caused some flakiness. The only reliable way of solving this issue we've found so far is waiting for 500 ms after closing the modal in every test that interacts with an input field after closing a modal, which is not ideal.