wireui / wireui

TallStack UI components
https://v1.wireui.dev
MIT License
1.37k stars 166 forks source link

version update from 1.17.9 to 1.17.10 breaks view behavior #773

Closed t1m0t closed 6 months ago

t1m0t commented 6 months ago

Describe the bug When upgrading to 1.17.10, my modals are opened on first render. In 1.17.9, behavior is as expected.

To Reproduce

  1. Go to page with a modal to be displayed
  2. Refresh the page, the modal shows
  3. Downgrade to 1.17.9, no modal opens in first render

Expected behavior Modals shouldn't open in first render.

Dependencies

Desktop (If applicable, please complete the following information):

willmkt commented 6 months ago

Updated today and I'm having the same problem.

PH7-Jack commented 6 months ago

Fixed on https://github.com/wireui/wireui/releases/tag/v1.17.12

judgej commented 6 months ago

Not sure how related this is, but 1.17.10 also broke this for us. This breaks JS by treating the @ as a syntax error (I guess it is no longer being pre-processed). This worked fine up to 1.17.9, and 1.17.12 did not fix it:

<x-wireui.button
    wire:click="$emit('openModal', 'my.modal.component', @js([$id]))"
    ...

The fix was to remove the @js() and move the array into the JS domain ($id is an integer for us, so no further encoding was needed):

<x-wireui.button
    wire:click="$emit('openModal', 'my.modal.component', [{{ $id }}])"
    ...

Just posting this here as additional context in case it helps others when searching.

Note: I'm unclear where the @js tag is coming from - Laravel, Livewire, WireUI or some other package.

I can raise this as a new issue if my original code should work, and wasn't fundamentally wrong to start with.