Skip to content

Commit

Permalink
feat(popover): add property openDirection
Browse files Browse the repository at this point in the history
  • Loading branch information
LucyChyzhova authored and adrianschmidt committed Jul 11, 2022
1 parent 484cc0d commit eb52462
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/popover/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { createRandomString } from '../../util/random-string';
import { zipObject } from 'lodash-es';
import { portalContains } from '../portal/contains';
import { ESCAPE } from '../../util/keycodes';
import { OpenDirection } from '../menu/menu.types';

/**
* A popover is an impermanent layer that is displayed on top of other content
Expand Down Expand Up @@ -75,6 +76,12 @@ export class Popover {
@Prop()
public open = false;

/**
* Decides the popover's location in relation to its trigger
*/
@Prop({ reflect: true })
public openDirection: OpenDirection;

/**
* Emits an event when the component is closing
*/
Expand Down Expand Up @@ -125,6 +132,7 @@ export class Popover {
visible={this.open}
containerId={this.portalId}
containerStyle={{ 'z-index': popoverZIndex }}
openDirection={this.openDirection}
>
<limel-popover-surface
contentCollection={this.host.children}
Expand Down

0 comments on commit eb52462

Please sign in to comment.