You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm following hypermedia.systems book and wondering how I would implement the VanillaJS version of the overflow menu in hyperscript.
Here's the book's version with VanillaJS:
<td><divdata-overflow-menu><buttontype="button"
aria-haspopup="menu"
aria-controls="contact-menu-{{ contact.contact_id }}"
>
Options
</button><divrole="menu" hiddenid="contact-menu-{{ contact.contact_id }}"><arole="menuitem" href="/contacts/{{ contact.contact_id }}/edit">Edit</a><arole="menuitem" href="/contacts/{{ contact.contact_id }}">View</a><arole="menuitem"
href="#"
hx-delete="/contacts/{{ contact.contact_id }}"
hx-confirm="Are you sure you want to delete this contact?"
hx-swap="outerHTML swap:1s"
hx-target="closest tr"
>Delete</a></div></div></td>
I have tried:
<td><divid="over-flow-button"
_="on click toggle the *display of the next <ul/>"
>
Options
<ulstyle="display: none"><ahref="/contacts/{{ contact.contact_id }}/edit">Edit</a><ahref="/contacts/{{ contact.contact_id }}">View</a><ahref="#"
hx-delete="/contacts/{{ contact.contact_id }}"
hx-confirm="Are you sure you want to delete these contacts?"
hx-target="closest tr"
hx-swap="outerHTML swap:1s"
>Delete</a></ul></div></td>
But this will choose the next instead of the current .
I also tried "on click toggle the *display of my <ul/>", but getting some weird error:
Unexpected value: >
on click toggle the *display of my <ul/>
^^
Any help would be appreciated!
The text was updated successfully, but these errors were encountered:
Hi team,
I'm following hypermedia.systems book and wondering how I would implement the VanillaJS version of the overflow menu in hyperscript.
Here's the book's version with VanillaJS:
I have tried:
But this will choose the next instead of the current .
I also tried "on click toggle the *display of my <ul/>", but getting some weird error:
Any help would be appreciated!
The text was updated successfully, but these errors were encountered: