Tooltip does not show if moving from one element with Tooltip to another and both elements are placed directly next to each other.
Example: If a number of Buttons (with title) are placed right next to each other if mouse is moved over the first one the tooltip is displayed correctly. If the mouse is moved to the next one the first tooltip closes but the second one does not show. Moving on to the third button the tooltip is displayed correctly again.
I'm using the ToolTip component to display tooltips for anything that has a "title":
<TelerikTooltip TargetSelector="[title]"></TelerikTooltip>
I've got a popup window with a close button that displays the tooltip "Close".
Upon clicking the button and the window closing, the tooltip remains until I click something or another tooltip appears.
If the element of the tooltip is on top of the screen (almost outside of the viewport), hovering the remaining part of the element makes the tooltip create a flashing effect.
Please watch the attached video.
When a position is specified the tooltip is rendered initially aside from the target element before displaying at the correct position
Reproduction: https://blazorrepl.telerik.com/wnaUkrFc04umFPWr03I need to make a tooltip more accessible.
---
ADMIN EDIT
The first thing you can do is use the aria-describedby on the tooltip targets and use its value in the tooltip Id parameter to help screen readers. It is up to the screen reader to detect the change in the DOM and read out the new content.
This item is to add attributes to the tooltip such as role="tooltip", aria-live="polite", role="presentation", aria-hidden="false". The exact attributes will depend on more detailed research and may differ from what I have listed here.
---
Using a target selector for HTML elements with a specific attribute within an SVG does not work
The following snippet worked correctly in 2.26.0 and older versions but does not work in 2.27.0
<TelerikArcGauge>
<ArcGaugeCenterLabel>
<Template>
@(context.Pointers[0].Value)
</Template>
</ArcGaugeCenterLabel>
<ArcGaugeScales>
<ArcGaugeScale Min="0" Max="100">
</ArcGaugeScale>
</ArcGaugeScales>
<ArcGaugePointers>
<ArcGaugePointer Color="#FFE162" Value="@FirstPointerValue"></ArcGaugePointer>
</ArcGaugePointers>
</TelerikArcGauge>
<TelerikTooltip TargetSelector="path[stroke='#FFE162']" Position="TooltipPosition.Top" ShowOn="@TooltipShowEvent.Hover" Id="first-pointer">
<Template>
<p>Value is: @FirstPointerValue</p>
</Template>
</TelerikTooltip>
@code {
public int FirstPointerValue { get; set; } = 20;
}
Best Regards,
Radko
Since 2.27 I have a weird behaviour when I try to open a tooltip that should be shown on click. This is a sample:
<span id="tooltip-here">
<span style="background-color: gray">Text 1</span>
gap
<span style="background-color: gray">Text 2</span>
</span>
<TelerikTooltip TargetSelector="#tooltip-here" ShowOn="TooltipShowEvent.Click" />
In 2.26 the tooltip was shown when I clicked in any element inside the outer span. Check file 226.gif.
Now, in 2.27 it is being shown just when I click on the "gap". Check file 227.gif.
Thanks!
I have a div which has a couple of buttons contained within it on the lower left corner. I have a TelerikTooltip with the target selector pointed to my div. Most of the time the tooltip works fine but I have found that if I move the mouse onto the div from the lower left corner where the buttons are, the TelerikTooltip shows up correctly while the mouse is over the buttons but when I move the mouse farther into the div and away from the buttons the TelerikTooltip gets hidden and a default tooltip is displayed.
It behaves this way whether I use a title on the div or a template on the TelerikTooltip.
As shown in the Tooltip - Show Event demo, the title does appear on hover as well as on click.
I was under the impression that this is not supposed to happen.
See the attached video for how to reproduce this.
A ToolTip will trigger a JavaScript error in the following scenarios:
The JS error is thrown on mouse click:
TypeError: undefined is not an object (evaluating 't.getAttribute')
When you move the mouse over the grid cells in this example, several tooltips can remain shown, especially if you move the mouse down so it goes through a tooltip when going towards the next row, and you move it quickly.
<div class="row">
<TelerikGrid Data="@Items">
<RowTemplate Context="sampleData">
@{
string detailLink = $"info/{sampleData.Id}";
string className = $"screenshot-hover-{sampleData.Id}";
string selector = $".{className}";
<td title="@sampleData.Name" data-id="@sampleData.Id" class="@className">
<NavLink href="@detailLink">@sampleData.Name</NavLink>
</td>
<td title="@sampleData.Name" data-id="@sampleData.Id" class="@className">
<NavLink href="@detailLink">@sampleData.Name</NavLink>
</td>
<td title="@sampleData.Name" data-id="@sampleData.Id" class="@className">
<NavLink href="@detailLink">@sampleData.Name</NavLink>
</td>
<TelerikTooltip TargetSelector="@selector" ShowOn="@TooltipShowEvent.Hover" Position="@TooltipPosition.Bottom">
<Template Context="ttipContext">
@{
var dataAttributes = ttipContext.DataAttributes;
var title = ttipContext.Title;
if (title != null && dataAttributes.ContainsKey("id"))
{
<img src="images/@(dataAttributes["id"])" alt="@title" />
<p>@title</p>
}
}
</Template>
</TelerikTooltip>
}
</RowTemplate>
<GridColumns>
<GridColumn Field="@(nameof(SampleData.Name))" />
<GridColumn Field="@(nameof(SampleData.Address))" />
<GridColumn Field="@(nameof(SampleData.PhoneNumber))" />
</GridColumns>
</TelerikGrid>
</div>
@code {
class SampleData
{
public int Id { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public string PhoneNumber { get; set; }
}
SampleData[] Items { get; set; }
protected async override Task OnInitializedAsync()
{
const int sampleSize = 25;
Items = new SampleData[sampleSize];
for (int i = 0; i < sampleSize; i++)
{
Items[i] = new SampleData
{
Id = i,
Name = $"{i}.SomeName",
Address = $"{i}{i}{i}{i} Cherry Lane",
PhoneNumber = $"1-512-{i % 100:00}4-6000",
};
}
await Task.CompletedTask;
}
}
I am getting the following error with them *only* when loading my site on an iPhone, after the page had been previously loaded on a PC.
2020-11-02T16:19:51.547Z] Error: Microsoft.JSInterop.JSException: An exception occurred executing JS interop: The JSON value could not be converted to System.Double. Path: $ | LineNumber: 0 | BytePositionInLine: 4.. See InnerException for more details.
---> System.Text.Json.JsonException: The JSON value could not be converted to System.Double. Path: $ | LineNumber: 0 | BytePositionInLine: 4.
---> System.InvalidOperationException: Cannot get the value of a token type 'Null' as a number.
at System.Text.Json.Utf8JsonReader.TryGetDouble(Double& value)
at System.Text.Json.Utf8JsonReader.GetDouble()
at System.Text.Json.Serialization.Converters.JsonConverterDouble.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
at System.Text.Json.JsonPropertyInfoNotNullable`4.OnRead(ReadStack& state, Utf8JsonReader& reader)
at System.Text.Json.JsonSerializer.HandleNull(Utf8JsonReader& reader, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, Utf8JsonReader& reader, Exception ex)
at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
at System.Text.Json.JsonSerializer.ReadValueCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack)
at System.Text.Json.JsonSerializer.ReadValueCore(Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Deserialize(Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
at Microsoft.JSInterop.JSRuntime.EndInvokeJS(Int64 taskId, Boolean succeeded, Utf8JsonReader& jsonReader)
--- End of inner exception stack trace ---
at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
at Telerik.Blazor.Components.TelerikTooltip.OnAfterRenderAsync(Boolean firstRender)
Hover the mouse several times in a row at element c on the demo stand. OS Windows 10, Browsers: Chrome Version 87.0.4280.141 (Official Build) (64-bit) + Firefox Developer 85.0b9 (64-bit).
Tell me why the component periodically has 2 tooltips? This anomaly is also observed on your demo stand.
1. Place two spans with titles right next to each other.
2. Add Telerik Tooltip with target span[title]
3. Hover over first span -> Tooltip is displayed correctly
4. Move Mouse Cursor from first span to second span -> Tooltip of second span is displayed twice: Once at correct position and once at top left of screen.