Skip to content

Fix cursor shape on iPadOS with physical pointer #586

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

Merged
merged 4 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ All notable changes to this project will be documented in this file. Take a look

* Implementation of the [W3C Accessibility Metadata Display Guide](https://w3c.github.io/publ-a11y/a11y-meta-display-guide/2.0/guidelines/) specification to facilitate displaying accessibility metadata to users. [See the dedicated user guide](docs/Guides/Accessibility.md).

### Fixed

#### Navigator

* Fixed the cursor shape on iPadOS when using a physical trackpad or mouse.


## [3.2.0]

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions Sources/Navigator/EPUB/Scripts/src/gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import { adjustPointToViewport } from "./rect";
import { findNearestInteractiveElement } from "./dom";

window.addEventListener("DOMContentLoaded", function () {
// If we don't set the CSS cursor property to pointer, then the click events are not triggered pre-iOS 13.
document.body.style.cursor = "pointer";

document.addEventListener("click", onClick, false);
});

Expand Down
4 changes: 3 additions & 1 deletion Sources/Navigator/Navigator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public extension Navigator {
}

public extension NavigatorDelegate {
func navigator(_ navigator: Navigator, locationDidChange locator: Locator) {}

func navigator(_ navigator: Navigator, didJumpTo locator: Locator) {}

func navigator(_ navigator: Navigator, presentExternalURL url: URL) {
Expand All @@ -163,7 +165,7 @@ public extension NavigatorDelegate {
true
}

func navigator(_ navigator: Navigator, didFailToLoadResourceAt href: String, withError error: ReadError) {}
func navigator(_ navigator: Navigator, didFailToLoadResourceAt href: RelativeURL, withError error: ReadError) {}
}

public enum NavigatorError: Error {
Expand Down
3 changes: 0 additions & 3 deletions Sources/Navigator/Toolkit/WebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ final class WebView: WKWebView {

func clearSelection() {
evaluateJavaScript("window.getSelection().removeAllRanges()")
// Before iOS 12, we also need to disable user interaction to get rid of the selection overlays.
isUserInteractionEnabled = false
isUserInteractionEnabled = true
}

override func buildMenu(with builder: any UIMenuBuilder) {
Expand Down