Htmxor icon indicating copy to clipboard operation
Htmxor copied to clipboard

Allow hx- action attributes (hx-get, hx-put, etc) without a value

Open egil opened this issue 1 year ago • 2 comments

Enabling the hx- action attributes to be used without specifying a value, which implicitly should set the current URL as the address.

egil avatar May 08 '24 13:05 egil

Arc -2024-05-29 -09-46-03

This might be a quirk of Razor and null values (null values are not rendered on elements). Setting an hx- element to an empty string defaults the behavior the current URL as expected.

JetBrains Rider -2024-05-29 -09-47-32

khalidabuhakmeh avatar May 29 '24 13:05 khalidabuhakmeh

That may actually be the correct. That is, I think that closes the issue. This way the user has been explicit in that they just want the current url by setting the empty string, where as null is undefined behavior.

egil avatar May 29 '24 14:05 egil