laravel-livewire-tables icon indicating copy to clipboard operation
laravel-livewire-tables copied to clipboard

Javascript error thrown when a column value contains the double quote character (")

Open javis opened this issue 2 years ago • 2 comments

Whenever a value for a column contains a double quote character the table throws a Javascript error like the following one:

Uncaught (in promise) DOMException: Failed to execute 'setAttribute' on 'Element': 'sed."' is not a valid attribute name.
    at Element.setAttribute (http://localhost/vendor/livewire/livewire.js?id=c69d0f2801c01fcf8166:13:148122)
    at morphAttrs (http://localhost/vendor/livewire/livewire.js?id=c69d0f2801c01fcf8166:13:81023)
    at morphEl (http://localhost/vendor/livewire/livewire.js?id=c69d0f2801c01fcf8166:13:87062)
    at http://localhost/vendor/livewire/livewire.js?id=c69d0f2801c01fcf8166:13:88518
    at morphEl (http://localhost/vendor/livewire/livewire.js?id=c69d0f2801c01fcf8166:13:90339)
    at http://localhost/vendor/livewire/livewire.js?id=c69d0f2801c01fcf8166:13:88518
    at morphEl (http://localhost/vendor/livewire/livewire.js?id=c69d0f2801c01fcf8166:13:90339)
    at http://localhost/vendor/livewire/livewire.js?id=c69d0f2801c01fcf8166:13:88518
    at morphEl (http://localhost/vendor/livewire/livewire.js?id=c69d0f2801c01fcf8166:13:90339)
    at http://localhost/vendor/livewire/livewire.js?id=c69d0f2801c01fcf8166:13:88518

This example error is given for a column containing the following value Mollitia sed" quis et perferendis sed.

By the error description I believe the column value is used as identifier of a DOM element, which is prone to errors. It seems like the error also happens even if the column in question is not in the selected columns definition (to be shown).

javis avatar Jun 08 '22 17:06 javis

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 09 '22 00:07 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 15 '22 15:08 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 30 '22 05:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 06 '22 21:11 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 14 '22 06:12 stale[bot]

I can not replicate this. I tried with a single double quote and a string wrapped in double quotes and I get no javascript errors.

rappasoft avatar Dec 21 '22 15:12 rappasoft

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 22 '23 06:01 stale[bot]