egil / Htmxor

Supercharges Blazor static server side rendering (SSR) by seamlessly integrating the Htmx.org frontend library.
MIT License
109 stars 12 forks source link

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

Open egil opened 2 months ago

egil commented 2 months ago

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

khalidabuhakmeh commented 2 months ago

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

egil commented 2 months ago

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.