hydrostack / hydro

Hydro brings stateful and reactive components to ASP.NET Core without writing JavaScript
https://usehydro.dev
MIT License
704 stars 17 forks source link

hydro-on tag helper does not work and not showing intellisense. #98

Closed gbthakkar closed 5 days ago

gbthakkar commented 1 week ago

I am trying to follow the example from document "Getting Started". And observed for the code below

that when I type "hydro" I do not see the intellisense for hydro-on:click

Please help.

Thank you.

kjeske commented 1 week ago

Hi! Due to some limitations in IDEs, the tag helpers using DictionaryAttributePrefix are not suggested. So you would have to write them without intellisense. They follow same convention as x-on directive from alpine js, so you can check the docs here. For example, if in alpine you have:

<input x-on:keyup.shift.enter="..." />

in Hydro it will be:

<input hydro-on:keyup.shift.enter="@(() => Model.SomeAction())" />
gbthakkar commented 1 week ago

oh, ok. Do you think that this will work in future?

kjeske commented 1 week ago

Hard to say. Not sure why IDEs are not showing even simple hydro-on suggestion at all, since it's a valid tag helper. I would need to raise a ticket.

When it comes to customization of the handler behaviour, for example hydro-on:keyup.shift.enter, that i doubt there will be intellisense for. There are many different combinations and there is not way to configure suggestions to it.

kjeske commented 5 days ago

Closing for now since currently there is no solution for that, if you have more questions feel free to ask :)