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

Custom modal was created with unknown prop "parent" #2176

Closed
Carlos-err406 opened this issue Oct 23, 2023 · 2 comments
Closed

Custom modal was created with unknown prop "parent" #2176

Carlos-err406 opened this issue Oct 23, 2023 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@Carlos-err406
Copy link

Current Behavior

Custom modals that don't use the parent prop I get the <SomeModal> was created with unknown prop 'parent'

Expected Behavior

not seeing the unknown prop warning in the console when not using the parent prop in Modal Components

Steps To Reproduce

  1. Do the modal setup following the skeleton ui docs
  2. Create a Modal Component (Custom Modal) without using the export let parent
  3. trigger the custom modal y see the console for the warning

Link to Reproduction / Stackblitz

No response

More Information

my suggestion is to still pass the parent data but not as a prop to modals, but through context, this way is more opt-in and less annoying.

@Carlos-err406 Carlos-err406 added the bug Something isn't working label Oct 23, 2023
@endigo9740
Copy link
Contributor

endigo9740 commented Oct 23, 2023

my suggestion is to still pass the parent data but not as a prop to modals, but through context, this way is more opt-in and less annoying.

That's an interesting suggestion.

I'm definitely not satisfied with how this works now, it's a very manual process to ensure parity for all props. The Context API wouldn't solve this issue either. At least if each value is provided piecemeal. Ideally what we need is a way to inherit or retrieve any and all values from the parent automatically (props, functions, etc).

There is some low level access Svelte provides for this, but I've been informed it's part an API that will likely change in the future. My hope is to test our options again when Svelte 5 drops. I'm really hoping for something that makes this more automatic.

In the meantime I think the Context API change can be reserved as our fallback plan.

@endigo9740
Copy link
Contributor

In an effort to prepare for Skeleton v3, we're consolidate some related issues down to a single ticket. This will ensure that we can see the full context of requests when the time comes to refactor and update this feature going forward. If you wish to add additional feedback or suggestions, please so here:

@endigo9740 endigo9740 modified the milestones: v3.0 (Next), v2.0 Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants