Monaca Onsen UI Discord Chat Github Repo

Bug? Popover with one list-item



  • Hi. I have the following code. It is a popover that covers a “md-more” toolbar button. It only has one list-item, but the popover seems to require two at a minimum and forces spaces for two. Please see screenshot for example output. I am using Onsen 2.8.3, but I’m not ready to upgrade at this point, so I don’t know if it’s still an issue or not.

    <ons-popover ... cover-target cancelable>
    	<ons-list>
    		<ons-list-item tappable>
    			Delete
    		</ons-list-item>
    	</ons-list>
    </ons-popover>
    

    0_1524157458377_Image4.jpg



  • So, I ended up just doing a little hack to adjust the minimum height of the popover. Taken from my css mod file:

    /* onsen-ui normally sets this at 100px.  that means you can't have a popup menu of just one list-item.  this change fixes that. */
    .popover__content{
    	min-height: 				0px;
    }
    

    Works for me.


  • Onsen UI

    I’m not sure why we do have that min-height. I guess it’s just a safety net, but in this case it’s definitely an issue. Thanks for the workaround.