owl icon indicating copy to clipboard operation
owl copied to clipboard

Add the closest variant for "t-portal"

Open rfr-odoo opened this issue 2 years ago • 2 comments

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]

rfr-odoo avatar May 08 '23 08:05 rfr-odoo

Maybe it shouldn't be an option and instead be the standard behavior

brboi avatar May 10 '23 08:05 brboi

i thought about this, but it would be a breaking change, and seems wrong

ged-odoo avatar May 10 '23 10:05 ged-odoo