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

[UI Framework] [K7] Fix KuiPopover examples. #13460

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions ui_framework/doc_site/src/views/popover/popover_anchor_position.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,32 @@ export default class extends Component {
super(props);

this.state = {
isPopoverOpen: false,
isPopoverOpen1: false,
isPopoverOpen2: false,
};
}

onButtonClick() {
onButtonClick1() {
this.setState({
isPopoverOpen: !this.state.isPopoverOpen,
isPopoverOpen1: !this.state.isPopoverOpen1,
});
}

closePopover() {
closePopover1() {
this.setState({
isPopoverOpen: false,
isPopoverOpen1: false,
});
}

onButtonClick2() {
this.setState({
isPopoverOpen2: !this.state.isPopoverOpen2,
});
}

closePopover2() {
this.setState({
isPopoverOpen2: false,
});
}

Expand All @@ -32,13 +45,13 @@ export default class extends Component {
<div>
<KuiPopover
button={(
<button onClick={this.onButtonClick.bind(this)}>
<button onClick={this.onButtonClick1.bind(this)}>
Popover anchored to the right.
</button>
)}
isOpen={this.state.isPopoverOpen}
isOpen={this.state.isPopoverOpen1}
closePopover={this.closePopover1.bind(this)}
anchorPosition="right"
closePopover={() => {}}
>
Popover content
</KuiPopover>
Expand All @@ -47,13 +60,13 @@ export default class extends Component {

<KuiPopover
button={(
<button onClick={this.onButtonClick.bind(this)}>
<button onClick={this.onButtonClick2.bind(this)}>
Popover anchored to the left.
</button>
)}
isOpen={this.state.isPopoverOpen}
isOpen={this.state.isPopoverOpen2}
closePopover={this.closePopover2.bind(this)}
anchorPosition="left"
closePopover={() => {}}
>
Popover content
</KuiPopover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export default class extends Component {
</button>
)}
isOpen={this.state.isPopoverOpen}
closePopover={this.closePopover.bind(this)}
bodyClassName="yourClassNameHere"
closePopover={() => {}}
>
It's hard to tell but there's a custom class on this element
</KuiPopover>
Expand Down