-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix to issue #4015 #4016
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
Fix to issue #4015 #4016
Conversation
Thank you, please undo the changes to the priv folder. The assets are updated after merging. |
Thank you @Yashaswini-Sharma, I fixed it via #4017 and added you as co-author. If you want to look less like AI, don't put so much effort into formatting your markdown. No human would do that :) |
Hi I am so sorry T_T, this is my first time contributing to a big repo. Thank you so much for your help! Usually I have heard there is a template for PRs but I am sorry I could not find it so I had gemini generate one for me |
All good, no worries! We only have an issue template. For PRs, if you just fix an existing issue, linking to it is usually all you need. I'd say you only need to provide as much information as necessary, so if the issue has a good description of what's wrong, that's already good. All you need to describe in the PR is things that are worth additional explanation, because they're not immediately clear from the code and the issue itself. |
Fix: Preserve Original Case in
phx-disable-with
ElementsSummary
This change addresses Fixes #4015 by updating the
phx-disable-with
logic to useel.textContent
instead ofel.innerText
when storing and restoring the original content of a disabled element.This ensures that the original, case-sensitive text is correctly restored once the element is re-enabled—preventing issues caused by CSS transformations (like
text-transform: uppercase
) that were permanently altering displayed text.Background
The
phx-disable-with
attribute in Phoenix temporarily replaces an element’s content while a form is being submitted and restores it once the request completes.Previously, this logic used
el.innerText
to capture the element’s text. However:innerText
returns rendered text (affected by CSS styles liketext-transform
).text-transform: uppercase
would store the modified version of the text (“INCREASE”) instead of the original one (“Increase”).This behavior caused problems in automated testing tools (e.g., Cypress) that rely on exact, case-sensitive text matching.
Fix
This update replaces: