Set popover max-width and max-height (before opening scroller)



  • Re: Set popover width & height

    For onsenUI2 is there any way to set the width. I had to manually set the topleft and width for each popover. Also how would one set up the maxHeight?


  • Onsen UI

    @Moshe-Flam As said in that post, .popover__content is the element you need to resize. However, since you want to apply max-height I guess you want scrollable content. If that’s the case, it is better to have another scrollable element inside the popover to avoid breaking styles (rounded borders) with the scrollbar:

      .custom-popover .popover__content {
        width: 300px;
      }
      .custom-popover .scrollable {
        max-height: 100px;
        overflow-y: auto;
      }
    

    Example here.

    I think this should be easier, I’ll have a look at it and see if it can be improved.


Log in to reply