openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

SplitContainer assumes it has a background when putting back master page in Popover mode

Open rg1 opened this issue 10 years ago • 3 comments

On the desktop, a SplitContainer in Popover mode adjusts to perceived portrait or landscape layout. If the window is sized suitably, the master pages are removed and only shown with a menu button. Now, if the window is now resized to be wide enough, the master pages should be placed back into the container. However the code line

rm.flush($master[0], false, 1);

in _updateMasterPosition places it at position 1 (which for the SplitApp would be after the background and before the detail pages) which in a plain SplitContainer is after the detail pages. As a result, the page is either in the wrong place or not visible at all (depending on whether the window was small initially or has been resized). Rerendering solves the problem, since it puts the elements back in the right order.

Here is a plunk to demonstrate the problem. You'll need to resize the output section appropriately in order to see the effect.

http://plnkr.co/edit/0u7hboAPpWEpaNg5rbfI?p=preview

Possible solutions include:

  • detect if the background div is present and adjust insert position accordingly
  • put the background handling from the SplitApp into the SplitContainer, so the background is always present (and the background settings in SplitContainer actually have an effect)
  • remove the special case rendering and rerender the whole app.

Best regards, Rolf.

rg1 avatar Feb 18 '16 13:02 rg1

Hi Rolf,

yes, this is a bug. Also reproducible in this alternative snippet: http://jsbin.com/luquha/1/edit?html,output

  • make output narrow
  • open master popover
  • make output wide -> master is missing

This does NOT happen when a SplitApp is used instead, as explained above (additional background div).

I think your problem analysis is fully correct. Thanks a lot!

Internally tracked as 1680012654.

Regards Andreas

akudev avatar Feb 18 '16 14:02 akudev

Hi Rolf, the reported issue is fixed with the following commit: https://github.com/SAP/openui5/commit/92058a735122f3c6de10000b930bfadd8db0c336

Thanks for reporting this, Evgeni

evkatsarski avatar Feb 22 '16 13:02 evkatsarski

...and this is downported to all branches down to 1.28.

akudev avatar Feb 22 '16 13:02 akudev