Skip to content

Fix MinimapView hitTest intercepting clicks when hidden#371

Open
sanvibyfish wants to merge 1 commit intoCodeEditApp:mainfrom
sanvibyfish:fix/minimap-hittest-hidden
Open

Fix MinimapView hitTest intercepting clicks when hidden#371
sanvibyfish wants to merge 1 commit intoCodeEditApp:mainfrom
sanvibyfish:fix/minimap-hittest-hidden

Conversation

@sanvibyfish
Copy link

Description

When showMinimap is set to false, MinimapView.isHidden is set to true. However, the hitTest(_:) override does not check isHidden, so the hidden minimap still intercepts all click events in its frame area (~140px on the right side of the editor). Combined with the empty mouseDown override, clicks are silently swallowed, preventing cursor placement on the right portion of the editor.

The fix adds guard !isHidden else { return nil } at the top of hitTest.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and works on my machine
  • My changes are documented

Screenshots

N/A — this is a one-line behavioral fix. The minimap is visually hidden but its hit area was still active.

When showMinimap is false, MinimapView.isHidden is set to true but
the hitTest override did not check isHidden. Combined with empty
mouseDown/mouseDragged overrides, this caused the hidden minimap to
silently swallow all click events in its frame area (~140px on the
right side of the editor), preventing cursor placement.

Add an isHidden guard at the top of hitTest so hidden minimap views
return nil and let clicks pass through to the underlying text view.

Closes CodeEditApp#370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MinimapView hitTest ignores isHidden, intercepts clicks when minimap is hidden

1 participant