mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
Tooltip outside props
commit_hash:0adbc8d8998913cf507d93951d06d45dee9c8eac
This commit is contained in:
@@ -172,7 +172,15 @@
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
rootCtx.onTooltipClose(internalId);
|
||||
if (componentContext.getJsonWithVars(data.close_by_tap_outside) !== false) {
|
||||
rootCtx.onTooltipClose(internalId);
|
||||
}
|
||||
|
||||
if (data.tap_outside_actions) {
|
||||
componentContext.execAnyActions(data.tap_outside_actions, {
|
||||
processUrls: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onWindowResize(): void {
|
||||
@@ -205,10 +213,13 @@
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
on:click={onOutClick}
|
||||
on:resize={onWindowResize}
|
||||
/>
|
||||
|
||||
<svelte:body
|
||||
on:click={onOutClick}
|
||||
/>
|
||||
|
||||
{#if visible && modal}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
|
||||
+2
@@ -121,6 +121,8 @@ export interface Tooltip {
|
||||
animation_out?: Animation;
|
||||
|
||||
mode?: TooltipMode;
|
||||
tap_outside_actions?: Action[];
|
||||
close_by_tap_outside?: boolean;
|
||||
}
|
||||
|
||||
export interface DivLayoutProvider {
|
||||
|
||||
@@ -72,7 +72,8 @@
|
||||
},
|
||||
"$description": "translations.json#/div_tooltip_tap_outside_actions",
|
||||
"platforms": [
|
||||
"ios"
|
||||
"ios",
|
||||
"web"
|
||||
]
|
||||
},
|
||||
"close_by_tap_outside": {
|
||||
@@ -81,7 +82,8 @@
|
||||
"default_value": "true",
|
||||
"platforms": [
|
||||
"android",
|
||||
"ios"
|
||||
"ios",
|
||||
"web"
|
||||
]
|
||||
},
|
||||
"background_accessibility_description": {
|
||||
|
||||
Reference in New Issue
Block a user