Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MorphMany in Tab group not working on Safari #6636

Closed
ryangurn opened this issue Dec 26, 2024 · 9 comments
Closed

MorphMany in Tab group not working on Safari #6636

ryangurn opened this issue Dec 26, 2024 · 9 comments

Comments

@ryangurn
Copy link

  • Laravel Version: 11.36.1
  • Nova Version: 5.0.5
  • PHP Version: 8.4.1
  • Database Driver & Version:
  • Operating System and Version: macOS 15.2
  • Browser type and version: Safari 18.2 (20620.1.16.11.8)
  • Reproduction Repository: https://github.com/ryangurn/nova-reproduce-repo

Description:

When using a Tab::group() with a MorphMany nova relationship within the group as mentioned in the documentation, the panel does not show up in Safari. Things work as expected within Chrome 131.0.6778.205.

Tab::group("Related", [
    HasMany::make("Estimates", "estimates", Estimate::class),

    HasMany::make("Invoices", "invoices", Invoice::class),

    MorphMany::make("Notes", "notes", Note::class),
]),

The above code example is not from my testing repo however I was able to replicate the same issue in the separate repo linked and using the App\Models\User model/resource and the App\Models\Note model/resource.

Safari Screenshot

image

Chrome Screenshot

image

Detailed steps to reproduce the issue on a fresh Nova installation:

  1. clone repo
  2. add some dummy data (nothing specific)
  3. attempt to view Tab group with MorphMany and it should match my attached screenshots.
@ryangurn
Copy link
Author

I also just realized that my example has a MorphOne() in the User model but the User resource had MorphMany(). I corrected this outside of the reproduction repo and I am still experiencing the same issue after adjusting the relationship defined in the User model.

@ryangurn
Copy link
Author

PS thanks for adding tabs, I am very very excited to utilize them and quite excited to see the detail page design progression out of the box continue to improve!

@crynobone
Copy link
Member

CleanShot 2024-12-27 at 10 11 55

Tested fine on Safari, the relationship does seems invalid to me, using MorphOne relationship but use MorphMany field.

@crynobone crynobone added the needs more info More information is required label Dec 27, 2024
@ryangurn
Copy link
Author

ryangurn commented Dec 27, 2024

@crynobone, the screenshot above is for a MorphOne, please attempt using MorphMany.

I also wonder if the situation only occurs with multiple tabs. Let me check my reproduction changes again (likely tomorrow PST).

@crynobone
Copy link
Member

crynobone commented Dec 27, 2024

Please check your reproducing repository

https://github.com/ryangurn/nova-reproduce-repo/blob/main/app%2FModels%2FUser.php#L52

also it's missing Note resource class and MorphMany field in User resource

@mziraki
Copy link

mziraki commented Dec 27, 2024

@ryangurn @crynobone if relationship field's collapsed status has been saved in browser's local storage and then you put them in new "tabs" panel introduced in Nova 5.0+, they will be hidden. you can clear browser storage cache for the site to fix it.
I don't know if it counts as a bug but a fix would be nice.

@crynobone
Copy link
Member

if relationship field's collapsed status has been saved in browser's local storage and then you put them in new "tabs" panel introduced in Nova 5.0+, they will be hidden.

If that the case here, both Safari and Chrome would have the same behavior.

@mziraki
Copy link

mziraki commented Dec 27, 2024

if relationship field's collapsed status has been saved in browser's local storage and then you put them in new "tabs" panel introduced in Nova 5.0+, they will be hidden.

If that the case here, both Safari and Chrome would have the same behavior.

@ryangurn you can make sure if this is the bug or not with clearing the safari's local storage for the site

@ryangurn
Copy link
Author

Using private browsing and ensuring the everything is consistently using MorphMany appears to have resolved the issue. I thought this might be a bug but alas turns out it was just some strange caching on my end.

@crynobone crynobone removed the needs more info More information is required label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants