Skip to content

Allow passing a function to align#207

Open
neoncube2 wants to merge 1 commit intoalexkatz:mainfrom
neoncube2:main
Open

Allow passing a function to align#207
neoncube2 wants to merge 1 commit intoalexkatz:mainfrom
neoncube2:main

Conversation

@neoncube2
Copy link

Allows passing a function to align, to determine the alignment based off of the position, e.g.:

function getAlignment(position) {
  return position === 'bottom' ? 'end' : 'center';
}
<Popover
  isOpen={true}
  positions={['bottom', 'left']}
  align={getAlignment}
  content={<div>example</div>}
>
  Click me
</Popover>

See #206

…gnment based off of the selected position.
@neoncube2
Copy link
Author

@alexkatz Just a reminder about this PR, if you have time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant