Forum Discussion

senadir's avatar
senadir
New Contributor
30 days ago

Adding data-1p-ignore dynamically isn't respected

Struggling with an issue in which I want to disable 1Password dynamically (after the string in the input is 3 letters or more). This seems to work with a hack (remove the item and then add it again) but stops working after.

The following codepen is an example:

https://codepen.io/senadir/pen/GgJBrBZ

The usecase is that I want to prioritize 1Password and system autofill but after 3 letters if nothing was matched for a customer I want to go ahead and search for the field. This works the first time but once you blur and focus the field again it stops working and it stops being respected.

2 Replies

  • Hello senadir​! 👋

    Thank you for reaching out. When a user clicks into a field, 1Password will analyze the page and note whether data-1P-ignore has been used. After this initial analysis, the field type is cached and isn't analyzed again. This explains the behaviour that you're seeing. 

    I brought this up internally and one suggestion was to use aria-expanded = true and role="combobox" when your search/suggestions is open since that should close 1Password's inline menu. I'm not a developer myself but I wanted to share this in case it helps with your use case.

    -Dave

    • senadir's avatar
      senadir
      New Contributor

      Thanks, we do set those attributes but they don't seem to be respected, at least in safari