Comments (1)
I was thinking about service injected to all dialogs, then when a component is mounted, the dialog is registered in service.
I think that this would be the way to go. We can use a service to store a stack of open Dialog
components that is pushed to/popped from when Dialog
components are mounted/unmounted. We know that a given Dialog
is the "active" one if it's at the head of the stack; not being the active one will require disabling the focus trap, among other things. I think I saw a library that implements a tracked Stack
class... I'll have to try to find it!
The issue that I see with yielding a Nested
component is that most of the ways I would see nesting of dialogs happening, one instance won't actually know about another. I could see a component that happens to use a modal itself being rendered inside of another modal, where the "inner" and "outer" aren't connected in any way.
I am quite curious about what a good solution around providing the information to the template about whether the Dialog
is active or not...
Since the React and Vue implementations don't do anything here, maybe we shouldn't either, even though we could? I would rather not provide an API initially and later introduce something than introduce something up front that we ultimately regret. I think leaning on the behavior of the official API, if in doubt, is a good idea.
from ember-headlessui.
Related Issues (20)
- Remove unused `@key` from `ListBox` sample code
- Implement `<RadioGroup>` component HOT 4
- Error in Embroider enabled apps using `@tagName` with `<Menu>` HOT 4
- Document Testing Best-Practices
- Some tests fail after upgrading `ember-auto-import` HOT 6
- Not compatible with ember 4 HOT 1
- Closing issue when using powerselect inside a dialog HOT 3
- Docs for using Tailwind HOT 4
- Implement Disclosure component HOT 7
- Bump `@embroider/macros` HOT 5
- Feedback welcome
- Transitions are throwing errors in Fastboot
- Move menu focus trap to containing element
- Implement <ComboBox> component HOT 2
- Build is broken due to external dependency hell HOT 10
- release config broken: Could not infer "repo" from the "package.json" file. HOT 2
- Click on `dialog.Overlay` does not close the modal HOT 1
- TypeError: can't convert value to string
- BUG: click outside <Dialog /> should be allowed HOT 6
- `<Transition>` with `<Dialog>` breaks clicking the overlay to close HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.