Skip to content
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

Vibrancy where vibrancy should not be #201

Open
LoganDark opened this issue Jun 16, 2018 · 13 comments
Open

Vibrancy where vibrancy should not be #201

LoganDark opened this issue Jun 16, 2018 · 13 comments
Labels

Comments

@LoganDark
Copy link

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

The UI explorer app, but my macOS is 10.14 Mojave.

Steps to Reproduce

Open the app.

Expected Behavior

The app should not be vibrant underneath certain controls (like buttons, etc)

Actual Behavior

image

There's vibrancy under the 'inline' button

image

There's vibrancy under the switches and radios

image

There's vibrancy under the spinners

image

The sidebar does not react well to vibrancy

image

Vibrancy under all single-line text fields

Reproducible Demo

https://github.com/ptmt/react-native-macos/files/199128/UIExplorer.zip

@ptmt
Copy link
Owner

ptmt commented Jun 16, 2018 via email

@LoganDark
Copy link
Author

I'd also be completely okay with dark mode support

@ptmt
Copy link
Owner

ptmt commented Jun 16, 2018

Current progress:
I added AppearanceManager that allows using system colors, that depends on the theme.
Fixed default color for text, it's not white anymore. Trying to eluminate hardcoded color constants now.
screenshot 2018-06-16 23 42 03

(of course, the initial issue still needs to be fixed)

@LoganDark
Copy link
Author

LoganDark commented Jun 16, 2018

LGTM, is an updated UIExplorer available yet?

@ptmt
Copy link
Owner

ptmt commented Jun 17, 2018

It's now RNTester in the latest version. I haven't finished yet, will keep posting here.

@ptmt
Copy link
Owner

ptmt commented Jun 17, 2018

Weird issues, fixed them, but it's not final. Also watched WWDC sessions about dark mode and want to improve the whole approach.
screenshot 2018-06-17 22 34 20
screenshot 2018-06-17 22 34 09

@aleclarson
Copy link
Collaborator

aleclarson commented Jan 28, 2019

@ptmt Can this be closed? Nevermind!

@LoganDark
Copy link
Author

@aleclarson Can I have a pre-built version of RNTester without the vibrancy issues?

@aleclarson
Copy link
Collaborator

aleclarson commented Jan 28, 2019

It's hard to tell if the "inline button" still has this issue, but I can confirm the others do still (except the sidebar seems to look fine now). No timeline on when I'll get around to solving this.

@aleclarson aleclarson added the bug label Jan 28, 2019
@LoganDark
Copy link
Author

Then please do not close the issue.

@aleclarson
Copy link
Collaborator

@LoganDark Wasn't planning on it! 😉

@aleclarson
Copy link
Collaborator

aleclarson commented Feb 14, 2019

We probably want to disable allowsVibrancy on all views by default, and add an allowsVibrancy prop to RCTView.

edit: Eh, that doesn't seem to work..

@aleclarson
Copy link
Collaborator

In the documentation on NSVisualEffectView, Apple says:

It is recommended that you enable vibrancy only in the leaf views of your view hierarchy. Subviews inherit the vibrancy of their parent. Once enabled in a parent view, a subview cannot turn off vibrancy. As a result, enabling vibrancy in a parent view can lead to subviews that look incorrect if they are not designed to take advantage of the vibrancy effect.

So the problem is that RCTRootView inherits from NSVisualEffectView and has vibrancy enabled by default.

We should disable vibrancy by default in RCTRootView and provide some mechanism for enabling such vibrancy in "leaf views" (as Apple puts it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants