javascriptwebix

How to catch distant Webix ui.text resize so as to resize related ui.popup


In webix, one use of ui.popup is to act as a drop down list of suggestions for a ui.text.

Of course, in a responsive UI, the width of the text box can change and the width of the drop down suggestions should change at the same time. In simply layouts, you can handle on onViewResize event on the ui.text element and push the new size to the ui.popup.

But in nested layouts, a resize does not fire onViewResize for the ui.text! The ui.text does resize, but the onViewResize event does not fire. So the ui.popup stays with the prior width.

See https://snippet.webix.com/6zx7ydt0 for a very simple functional example.

In the snippet there are **two ** resize handles. The first cascades to the ui.popup, but not the second. The second is my headache.

I have tried several locations for another onViewResize handler but no joy. ui.layout does not seem to support onViewResize.


Solution

  • I guess you missed 1 spot: https://snippet.webix.com/kla932y3 innerLayout is the right place. The resizer resizes the inner layout, so the event fires for it.