Skip to content
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

Remove escape chars on input columns #14903

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

angelej
Copy link
Contributor

@angelej angelej commented Nov 27, 2024

Description

Both, the TextInputColumn and SelectColumn have an <input type="hidden" x-ref="newState> field.
This field stores the current state but escapes the double quote character with a backslash.
When the TextInputColumn contains double quotes and gets stored, the field renders the escape characters in the browser. On the next update, the escape characters also gets stored in the db.
Also, if someone decides to use the SelectColumn with an options key containing a double quote, that option cannot be selected.

I wasn't able to inject the double quote char without breaking the x-init="" attribute, so I used String.fromCharCode(34) instead. Maybe there is better solution.

Visual changes

image image
  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

@danharrin danharrin added the bug Something isn't working label Nov 29, 2024
@danharrin danharrin added this to the v3 milestone Nov 29, 2024
@danharrin danharrin merged commit 7267a92 into filamentphp:3.x Nov 29, 2024
1 check passed
@angelej angelej deleted the fix-input-columns branch November 29, 2024 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants