owl
owl copied to clipboard
Add the closest variant for "t-portal"
Actually the portal is place in the first match for the specified selector, but when a component is set a second times (in a model for example) the second portal goes behind the modal.
It is possible to add a closest variant to the t-portal ?
e.g.:
<t t-name="web.SearchBar" owl="1">
<div t-if="state.showSearchBar" class="o_cp_searchview" t-ref="root">
<SearchBarMenu/>
</div>
<t t-portal.closest="'.o_control_panel_navigation'">
<button t-on-click="onToggleSearchBar">
<i class="fa fa-fw fa-search"/>
</button>
</t>
</t>
Actual result in OWL
BODY
-.control_panel
--.o_control_panel_navigation
---button [1]
---button [2]
--.o_cp_searchview [1]
-.modal
--.control_panel
---.o_control_panel_navigation
---.o_cp_searchview [2]
Desired result
BODY
-.control_panel
--.o_control_panel_navigation
---button [1]
--.o_cp_searchview [1]
-.modal
--.control_panel
---.o_control_panel_navigation
----button [2]
---.o_cp_searchview [2]
Maybe it shouldn't be an option and instead be the standard behavior
i thought about this, but it would be a breaking change, and seems wrong