Replies: 10 comments
-
|
That's really strange. I do tend to use FireFox for all my development, but I just double-checked in Chrome (version 104.0.5112.101 on a M1 Mac) and it seems to be working ok for me. Kapture.2022-08-27.at.08.17.44.mp4What version of Chrome are you on, what OS, and do you see any web dev console errors or anything? Sorry you are running into this problem! |
Beta Was this translation helpful? Give feedback.
-
|
Hey, thanks for getting back! Hope this helps! I |
Beta Was this translation helpful? Give feedback.
-
|
One other thought: can you open a new new incognito window in Chrome and/or disable all plugins? I wonder if something weird is happening there? |
Beta Was this translation helpful? Give feedback.
-
|
Hey @adamghill, That actually seems to have solved the issue. It works just fine in an incognito window but after clearing the cache in my regular browser the issue persists. It also works fine in a different chrome profile. My best guess at the moment is that it's clashing with a chrome extension I have installed so I'll try and deduce what it could be and report back! Thanks so much for your help Edit: It seems like it's my Nordpass chrome extension which is wiping the field! Why, I've got no clue but I disabled them all and re-enabled one-by-one and narrowed it down. This is the culprit https://chrome.google.com/webstore/detail/nordpass%C2%AE-password-manage/fooolghllnmhmmndgjiamiiodkpenpbb?hl=en |
Beta Was this translation helpful? Give feedback.
-
|
OK! I know |
Beta Was this translation helpful? Give feedback.
-
|
Testing on http://localhost:8080/text-inputs with the |
Beta Was this translation helpful? Give feedback.
-
|
Fantastic 😂 Glad to hear about the work around, means I can get on with my site! Thanks so much for your help with this. I'll just use a key for now, do you reckon this will be something that has to be fixed in |
Beta Was this translation helpful? Give feedback.
-
|
I don't think there has been an updated release of |
Beta Was this translation helpful? Give feedback.
-
|
I have the same issue with Bitwarden.
How did you manage to make it work @adamghill ? I don't understand how to replace the |
Beta Was this translation helpful? Give feedback.
-
|
This behavior isn’t a bug in Unicorn itself—it usually comes down to browser extensions (like NordPass or Bitwarden) interfering with input fields and how Unicorn uses morphdom to update the DOM. When you type into a field with unicorn:model, Unicorn sends a request and updates the DOM with the new component state. If morphdom replaces the element, certain browser extensions may “reset” the field, making it appear as though Unicorn cleared it. How to fix it Use unicorn:key on your input This tells morphdom to preserve the input element between updates, preventing extensions from wiping its value. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
I'm working on integrating Unicorn into a new project and want to build a form with it to remove the need for lots of JS.
I'm in the very early stages of setup and I'm running into an error with
unicorn:model.When typing in an input field unicorn sends a request as is intended. However, once the request is sent ( or received, I'm not too sure) the input which I have added
unicorn:model="name"to the field gets emptied.See the gif below for a demo of what's happening. I used the example

Hello Worldcomponent from the docs to create the example.The request seems okay:
Payload
Response
If you need any more information let me know! I'm sure this is user error rather than something wrong with the framework but I thought it worth reporting.
Edit: I just created a brand new project to test this out completely isolated and got the same result
Edit 2: It also happens when I have a forked version of this repo set up locally and use the built in examples in the local dev environment
Edit 3: This seems to be a Chrome specific bug as the code works fine in safari!
Beta Was this translation helpful? Give feedback.
All reactions