verbb / hyper

A Craft CMS plugin for managing links, focusing on user experience.
Other
22 stars 14 forks source link

[Craft 5] Custom light switch field doens't work when switching from link type #167

Closed DavidLaridon closed 3 months ago

DavidLaridon commented 4 months ago

Describe the bug

I added a light switch field to my hyper field (with Entry and URL type enabled). When i open an entry that has a the hyper field in a slideout, the custom light switch isn't working when i click it. It only works after i save the entry once with the URL type active. After that when I open the entry again, the URL type is the new default and the light switch works.

There seems to be something wrong when switching from link type. The custom field's functionality (maybe javascript) doesn't seem to trigger properly. image

Steps to reproduce

  1. Make a link field (with options Entry and URL, default on Entry)
  2. Add a custom light switch field to the first tab of the URL type (and only the URL type)
  3. Add the link field to entry type A
  4. Make an entries field where you can select one or more entries of entry type A
  5. Make a new section with entry type B
  6. Add the entries field to the section of entry type B
  7. In an entry of type B, try to make a new entry of type A (in a slideout)
  8. In the hyper link field switch from Entry to URL
  9. Try to turn on the light switch.

Craft CMS version

5.1.7

Plugin version

2.0.1

Multi-site?

Yes

Additional context

No response

engram-design commented 4 months ago

Fixed for the next release. To get this early, run composer require verbb/hyper:"dev-craft-5 as 2.0.1".

engram-design commented 3 months ago

Fixed in 2.0.2