-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interaction glitch w/ BitWarden #23
Comments
Hey Christian! Hmm, that's weird. Can you inspect that text input and show me what the element looks like to see what BitWarden might be doing? Maybe I can deal with it relatively easily? I'm also wondering if you see any console errors? I'm trying to spit out useful messages when possible. |
Interesting that I don't have the same issues with 1Password. However, I added the Bitwarden Firefox extension and can replicate what you are seeing. Not sure exactly how to fix, yet. It does look like Livewire has similar issues with autofills (livewire/livewire#1081) so I'll be watching how they fix with interest to see if there is a clean way to deal with this issue. |
I updated the example component to use the new |
@adamghill it looks like livewire fixed the issue in livewire/livewire#1721. Any thoughts about whether their solution can be ported to django-unicorn? |
I'm getting the same exact issue with or without the |
I tried the example that was giving me the issue (https://www.django-unicorn.com/examples/todo) and it works fine now though another example (https://www.django-unicorn.com/examples/search) which doesn't have the |
After reading through some Livewire and Bitwarden issues and trying a few attempts to solve for this, I'm not sure I'm any closer to fixing this. I'd love a PR, though if anyone is interested in tackling it. |
Spent some time looking at this tonight. It's not something BitWarden-specific but something the BitWarden extension does (the 1Password extension use to do this as well because that's where BitWarden got it from, see https://github.com/bitwarden/browser/blob/176c14188ca3fe55c88687658dc350e2c31a0226/src/content/autofill.js). I was able to distill it down to the following repeatable process:
I might get a chance to test more tomorrow to confirm but my guess is the changing of the existing DOM before unicorn does the morphdom process is glitching things up. |
Ah, interesting! Yeah, |
I've done some more testing and 3rd party code that does anything with the input tag before Oddly, I haven't been able to find a working example of Phoenix Liveview to test this theory but since it uses I did find a way to make things work (for various definitions of "work") by changing the search component template slightly to return back what the current value of the box should be:
Will it break extensions that muck around with the DOM? Sure, but better they be broken then allowing them to break your application. The only other thing I can think of is unicorn clones the DOM of the component before the call, does a |
I can see why this works, but it does feel sub-optimal and redundant. Or at least it takes away some of the "magic" of
Yeah, I'd love to avoid that complexity if at all possible. However... I might try to see if I could get that to work. One thing I'm curious about is testing out https://alpinejs.dev/plugins/morph as a replacement to |
I haven't picked through it all yet but I did stand up a Laravel Livewire project and recreated the search:
and it continues to work properly even with the offending 3rd party javascript added to the browser window. It clearly overwrites the DOM -- the troublesome attribute is no longer there -- so they must do a post |
hello Adam, long time no talk!
I was trying out the demo on the website and something BitWarden is doing to the input box, I think added it's own attribute to the html, causes the input to be redrawn empty but if you click the button add it will still load something but not everything.
Video:
django-unicorn-glitch.mov.zip
If I disable BitWarden and reload the page, the interaction works fine.
The text was updated successfully, but these errors were encountered: