Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update _toolTip even if toolTipText isn't available #479

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions components/RangeSelector/src/RangeSelector.Input.Drag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private double DragThumb(Thumb? thumb, double min, double max, double nextPos)

Canvas.SetLeft(thumb, nextPos);

if (_toolTipText != null && _toolTip != null && thumb != null)
if (_toolTip != null && thumb != null)
{
var thumbCenter = nextPos + (thumb.Width / 2);
_toolTip.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
Expand All @@ -99,15 +99,16 @@ private void Thumb_DragStarted(Thumb thumb)
Canvas.SetZIndex(otherThumb, 0);
_oldValue = RangeStart;

if (_toolTipText != null && _toolTip != null)
if (_toolTip != null)
{
_toolTip.Visibility = Visibility.Visible;
var thumbCenter = _absolutePosition + (thumb.Width / 2);
_toolTip.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
var ttWidth = _toolTip.ActualWidth / 2;
Canvas.SetLeft(_toolTip, thumbCenter - ttWidth);

UpdateToolTipText(this, _toolTipText, useMin ? RangeStart : RangeEnd);
if (_toolTipText != null)
UpdateToolTipText(this, _toolTipText, useMin ? RangeStart : RangeEnd);
}

VisualStateManager.GoToState(this, useMin ? MinPressedState : MaxPressedState, true);
Expand Down
Loading