Hello folks, Getting to grips with typing in an `...
# general-chat
f
Hello folks, Getting to grips with typing in an
input
field housed within a shadow DOM. Using the
.shadow()
API I'm able to type in a string manually in Chrome, but when I attempt this in Cypress/Chrome, the field clears itself after every keypress. The
input
will clear when a user clicks out of the field. From what I can see, it seems like the focus is being lost after every keypress Has anyone else encountered something like this?
Here's the code in question.
Copy code
cy.getByTestId("zd-content-tags-select")
  .shadow()
  .within(() =>
    cy.getByTestId("content-tag-select-menu")
    .find("input")
     .click()
     .type("foo")
   
)
e
Hi @fresh-doctor-14925 here’s my example it is happening again ..
f
Thanks shiela, out of interest: how is 'Christchurch' populated in the field? Is that a default value?
e
It supposed to be empty I don’t know why it’s pre-filled I will ask the developer.. if I do it on live then fill up the form manually all fields are empty..
22 Views