-
Notifications
You must be signed in to change notification settings - Fork 4k
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
<Popup /> Component #193
Comments
1. Use
|
Hm, I'd have to play with the code for a bit, but here are a few more ideas to consider: 1.
|
What I like about the Also, in keeping with our rule of "props or children but never both", I think the const RenderProps = () => (
<Popup
title='Elliot Fu'
content='Elliot has been a member since July 2012'
render={<Image src='/images/avatar/small/elliot.jpg' avatar />}
/>
) |
@levithomason (Not meaning to be pushy but just asking) Any idea when this might arrive? |
Here are my personal priorities. My first focus is #269, updating legacy components to our v1 API. Once all these are done, I'll focus on #243, migrating to Semantic-Org. I will continue to give time daily to bug fixes and PR reviews as they arise. After those two issues are closed, I'll continue focusing on daily bugs and PRs. I also plan to then focus on new components. Components we need at @TechnologyAdvice will come first. Second, I'll focus on components I am personally interested in. So, it will be a while before I personally get to this component. However, I would support a PR immediately. |
Hey @levithomason , I'm pretty excited to use stardust for my own things and would like to contribute to it! I would like to start by taking a stab at the popup component since it seems like it's not one of your priorities. As you suggested this option, I would like to use a target as the origin of the popover to keep it detached from it. I added some example using what I have in mind. I want to make sure I follow the patterns for V1 and I would like to have your opinion before I start anything. Let me know. A Popup without children <SomeElement ref="my_element" />
<Popup target="my_element" tooltip="foo bar" inline /> a Popup with a content as child with a position <SomeElement ref="my_element" />
<Popup target="my_element" position="top-center">
Phasellus enim lacus, finibus nec pretium ut,
interdum sit amet sapien.
</Popup> a Popup with a Header and a Content using a size variation <SomeElement ref="my_element" />
<Popup target="my_element" variation="very wide">
<Popup.Header>Foo Bar</Popup.Header>
<Popup.Content>
Phasellus enim lacus, finibus nec pretium ut,
interdum sit amet sapien.
</Popup.Content>
</Popup> Props would be something in those lines (inspired by the SUI doc) :
|
@Debrice thanks for picking this issue back up! Let's avoid We can still separate the Popup from the trigger component by passing the actual trigger component to the Popup. The Popup will render it's trigger in it's place. The Popup markup itself will be rendered to the body using Portal. I imagine this would working something like the following: const trigger = <Button>Has Popup</Button>
<Popup
trigger={trigger}
title='Elliot Fu'
content='Elliot has been a member since 2012'
/> This would render a As for props, let's try to keep parity with SUI's I'd gladly review and help if you wanted to start a PR. |
Sounds good, I'll start a PR and let you know when it's worth reviewing! |
@levithomason I'm facing an issue on render. Since the Popup is responsible for rendering trigger, in order for the Popup to render itself too (through Portal) I would have to wrap them in a parent DOM element (since I now have 2 elements to render). This causes an issue since the style of the trigger would be corrupted by the container element: render() {
return <div>{this.props.trigger}{this.state.popup ? <Portal>popup</Portal>: null }</div>
} I know I can do it with a ref (since the element would be detached), but after reading #405, I'm trying to stay away from these. I have to admit, I'm stuck on that one. I put my work on a pull request #570 for you to check it out. |
Thanks, we'll continue the convo there. |
Hi , how can i render semantic ui popup with existing DOM element as a trigger ? All the examples render the trigger component inline
|
Use SO and Gitter for questions, do not necropost please. |
http://semantic-ui.com/modules/popup.html
The text was updated successfully, but these errors were encountered: