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 or left not given, usual positioning algorithm used value.

i'd happy know if there's better way, far best come with.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -