-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Describe the bug
Tapping on chart elements to activate a tooltip does not work as expected when Safari is set to Request Desktop Website in an iPad.
As I found out, it is because the navigator.userAgent string that it reports in this mode is not covered by the regex defined in the tooltip.directive.ts in order to set the appropriate timeout value.
ngx-charts/projects/swimlane/ngx-charts/src/lib/common/tooltip/tooltip.directive.ts
Line 118 in 47a07d1
| : this.tooltipShowTimeout + (navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) ? 400 : 0); |
Instead, its navigator.userAgent string reports as:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15
To Reproduce
Steps to reproduce the behavior:
- Using the browser Safari on an iPad, navigate to https://swimlane.github.io/ngx-charts/#/ngx-charts/tooltip-templates.
- Click on any of the vertical bars shown in the page.
- No tooltip is shown.
Expected behavior
Regardless if Desktop or Mobile browsing mode is set iPad Safari, the tooltip should activate and show the relevant info.
Screenshots
With Safari set to "Request Desktop Website", the tooltip does not activate after tapping on the United Kingdom bar.

Demo
N/A
ngx-charts version
v21.1.0 in the link provided above, but the same bug occurs with v22.0.0, used in our app.
Additional context
Angular Version: v19.2.13
Test device settings
iPad Pro 11
OS: iOS, v17.5
Browser: Safari