javascript - How to position a popover in Ionic 2 -
how manually position popover in ionic 2?
i can't set position in css class, since popover controller sets position inline style.
looking through code, there doesn't seem option popover's position. however, when opening popover result of user tapping something, can positioned click event. can use knowledge manual positioning well:
let pop = this.popoverctrl.create(mypopover); let ev = { target : { getboundingclientrect : () => { return { top: '100' }; } } }; pop.present({ev});
a few things note:
- you can set value
top
,left
, or both. - the values must given in pixels, numbers.
- if
top
orleft
not given, usual positioning algorithm used value.
i'd happy know if there's better way, far best come with.
Comments
Post a Comment