Skip to content

Sample project for FB11988707 that demonstrates a SwiftUI hover bug in macOS.

Notifications You must be signed in to change notification settings

siracusa/SwiftUIHoverBug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sample Project for FB11988707

SwiftUI's .onHover View method fails sporadically when applied to a view that does not cover the entire containing window and that window has a “clear” background color. This sample project demonstrates the bug, which has been filed with Apple as FB11988707.

The workaround is to make the background color anything that is not “clear.” Search for “WORKAROUND” in the SwiftUIView.swift file in this project to see the (commented-out) code for the workaround. Note that a color like this will also work:

Color(nsColor: NSColor(deviceWhite: 1, alpha: 0.001))

while still appearing “clear” in most contexts:

About

Sample project for FB11988707 that demonstrates a SwiftUI hover bug in macOS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages