Changed slideover to popover and dialog - #46
Conversation
…components into feature/popover-slideover
|
Looking good 🚀
I think we should keep this support maybe in some cases we still want a button as a label.
Breaking change so I think this should be a 3.0 release.
I don't think it is necessary as we discussed this f2f. |
…components into feature/popover-slideover
…components into feature/popover-slideover
|
| <x-rapidez::slideover id="default-slideover" closedby="any"> | ||
| <x-rapidez::slideover.header> | ||
| Title | ||
| <x-rapidez::slideover.close command="close" commandfor="default-slideover" /> |
There was a problem hiding this comment.
Could we make command="close" the default for the close and back components and inherit the parent slideover’s id for commandfor, for example using @aware? That way, userss could simply use <x-rapidez::slideover.close /> without repeating these attributes for every slideover, while still being able to override them when needed
There was a problem hiding this comment.
There are some ways but since you can choose between a dialog and a popover those attributes differ from eachother. We can make some magic that that can detect what type you use and add those attributes but that feels wrong in my opinion.
Also when you nest popovers (slideover inside a slideover) you can target the parent popover to close them both if you navigate a layer deeper. By keeping it simple like this it does require some default attributes to specify what you want it to do.
There was a problem hiding this comment.
I've tried the following, added aware that checks if parent component has the id attribute, and uses that automatically for the close commandfor and popovertarget. I've added both attributes for dialog and popover by default so that you don't have to explicitly add them each time.
The component looks like the following

Issue is that i would have another back.blade.php file that looks like the close.blade.php component doing the exact same thing.
|
There was a problem hiding this comment.
I feel like this is missing an example of the popover, these are all dialog slideovers.
There was a problem hiding this comment.
Visually it's exactly the same (same component same styling), within the <x-slideover component i've added simple instructions on how you can use the attributes on your button to trigger it as a popover or dialog.
If others also agree I'll add it :)
| This setup enables form reset logic and ensures proper background backdrop behavior. | ||
| <button popovertarget="example" popovertargetaction="show"> | ||
| Open slideover as popover | ||
| </button> |
There was a problem hiding this comment.
With these instructions the x button on the slideover won't work if you use the popover variant. I also feel like these buttons could be turned into a component themselves, as to reduce room for mistakes (+ these attributes aren't obvious and will need to be looked up every time)
There was a problem hiding this comment.
As we found out just now, you can also use commandfor="example" command="show-popover". This makes it much easier to differentiate between the two variants.
There was a problem hiding this comment.
Ah yes, great find! But is commandfor less suported? And because of that it's better to use the popovertarget and popovertargetaction attributes?

The new slideovers are here. Fully made with the popover and dialog functionality. No more magic and full control over each element.
Notes
Options
Known issues
Variants
Questions
resources/views/components/button/tag.blade.php?Usage

Slideover mobile usage

Nested usage

New

Old
