Closed iwarshak closed 3 years ago
@iwarshak thanks for the report! I can confirm that this is an issue -- I think it has to do with how the discardError
method is called during morphdom patching - when patching it seems to only be called on the modal and not it's children while in a full mount it is called on every child.
I think this has something to do with it's use in onBeforeNodeAdded
and onBeforeElUpdated
, and the way morphdom traverses the tree...
@mveytsman Yes, I tracked it down to it: onBeforeNodeAdded
gets called for the outer div containing the input, but it doesn't recurse into the contents of that div - which is I think similar to what you are saying
@mcrumm remind me, did we dig into this and fix this already or something related but different?
Derp, I see we reference this as closed. All fixed! ❤️❤️❤️🐥🔥
Environment
Actual behavior
When navigating to a form (via live_patch) which has an input with
phx_feedback_for: input_id(f, :name)
, thephx-no-feedback
is not applied.But if you refresh this page, or do a normal
link
to it (or manually navigate to the page), thephx-no-feedback
IS applied.This leads to unpredictable behavior if you are applying styles to these form elements.
I have a repo which you can use to see this quickly. https://github.com/iwarshak/phx-no-feedback-bug
1) visit http://localhost:3999/users 2) click the 'New User' link, and notice that the name field doesn't have the
phx-no-feedback
class 3) refresh this page and see that now it does have thephx-no-feedback
class