mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-14 08:51:27 +08:00
fix(module: tooltip): wrong popup direction (#1348)
This commit is contained in:
parent
9ff708eb31
commit
f4a3b60047
@ -94,7 +94,7 @@ namespace AntDesign.Internal
|
||||
{
|
||||
get
|
||||
{
|
||||
return _placement;
|
||||
return RTL ? _placement.GetRTLPlacement() : _placement;
|
||||
}
|
||||
set
|
||||
{
|
||||
@ -151,14 +151,6 @@ namespace AntDesign.Internal
|
||||
protected Overlay _overlay = null;
|
||||
private ElementReference _triggerReference;
|
||||
|
||||
public override Task SetParametersAsync(ParameterView parameters)
|
||||
{
|
||||
_paramPlacement = RTL ? PlacementType.BottomRight : PlacementType.BottomLeft;
|
||||
_placement = RTL ? PlacementType.BottomRight : PlacementType.BottomLeft;
|
||||
|
||||
return base.SetParametersAsync(parameters);
|
||||
}
|
||||
|
||||
protected override void OnAfterRender(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
@ -352,7 +344,7 @@ namespace AntDesign.Internal
|
||||
|
||||
protected virtual void OnMouseUp(JsonElement element)
|
||||
{
|
||||
if (_mouseInOverlay == false && _mouseInTrigger == false && Visible)
|
||||
if (_mouseInOverlay == false && _mouseInTrigger == false)
|
||||
{
|
||||
if (OnMaskClick.HasDelegate)
|
||||
{
|
||||
|
@ -77,5 +77,23 @@
|
||||
return PlacementDirection.Bottom;
|
||||
}
|
||||
|
||||
internal PlacementType GetRTLPlacement()
|
||||
{
|
||||
if (this == TopLeft) return TopRight;
|
||||
if (this == TopRight) return TopLeft;
|
||||
|
||||
if (this == Left) return Right;
|
||||
if (this == LeftTop) return RightTop;
|
||||
if (this == LeftBottom) return RightBottom;
|
||||
|
||||
if (this == Right) return Left;
|
||||
if (this == RightTop) return LeftTop;
|
||||
if (this == RightBottom) return LeftBottom;
|
||||
|
||||
if (this == BottomLeft) return BottomRight;
|
||||
if (this == BottomRight) return BottomLeft;
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user