Fixed #2536 - Tooltip new fitContent property
parent
21a5a6af7a
commit
380345a146
|
@ -120,6 +120,10 @@ function create(el) {
|
||||||
|
|
||||||
container.style.display = 'inline-block';
|
container.style.display = 'inline-block';
|
||||||
|
|
||||||
|
if (el.$_ptooltipFitContent) {
|
||||||
|
container.style.width = 'fit-content';
|
||||||
|
}
|
||||||
|
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,12 +297,14 @@ const Tooltip = {
|
||||||
target.$_ptooltipDisabled = false;
|
target.$_ptooltipDisabled = false;
|
||||||
target.$_ptooltipEscape = false;
|
target.$_ptooltipEscape = false;
|
||||||
target.$_ptooltipClass = null;
|
target.$_ptooltipClass = null;
|
||||||
|
target.$_ptooltipFitContent = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
target.$_ptooltipValue = options.value.value;
|
target.$_ptooltipValue = options.value.value;
|
||||||
target.$_ptooltipDisabled = options.value.disabled || false;
|
target.$_ptooltipDisabled = options.value.disabled || false;
|
||||||
target.$_ptooltipEscape = options.value.escape || false;
|
target.$_ptooltipEscape = options.value.escape || false;
|
||||||
target.$_ptooltipClass = options.value.class;
|
target.$_ptooltipClass = options.value.class;
|
||||||
|
target.$_ptooltipFitContent = options.value.fitContent || true;
|
||||||
}
|
}
|
||||||
|
|
||||||
target.$_ptooltipZIndex = options.instance.$primevue && options.instance.$primevue.config && options.instance.$primevue.config.zIndex.tooltip;
|
target.$_ptooltipZIndex = options.instance.$primevue && options.instance.$primevue.config && options.instance.$primevue.config.zIndex.tooltip;
|
||||||
|
|
|
@ -97,6 +97,12 @@ directives: {
|
||||||
<td>true</td>
|
<td>true</td>
|
||||||
<td>By default the tooltip contents are rendered as text. Set to true to support html tags in the content.</td>
|
<td>By default the tooltip contents are rendered as text. Set to true to support html tags in the content.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>fitContent</td>
|
||||||
|
<td>boolean</td>
|
||||||
|
<td>true</td>
|
||||||
|
<td>Automatically adjusts the element position when there is not enough space on the selected position.</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue