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

fix unexpected switching animation #100

Merged
merged 1 commit into from
May 17, 2023

Conversation

metacodes
Copy link
Contributor

@metacodes metacodes commented May 17, 2023

fixes #60
fixes #59

@sindresorhus
Copy link
Owner

Thanks for working on this.

I'm still seeing the animation problem when I start on the "Accounts" tab in the Example app and then switch to the "General" tab.

@metacodes
Copy link
Contributor Author

Thanks for working on this.

I'm still seeing the animation problem when I start on the "Accounts" tab in the Example app and then switch to the "General" tab.

You can reproduce this issue by starting on "General" tab and then switch to "Accounts" tab. If you set translatesAutoresizingMaskIntoConstraints to be false, then the animation will work correctly.(Tested on macOS 13.2.1)

@sindresorhus sindresorhus merged commit 9768c8a into sindresorhus:main May 17, 2023
@sindresorhus
Copy link
Owner

Thanks ;)

@DivineDominion
Copy link
Collaborator

I wonder if

a) this may be too intrusive? If the view was assembled from code, this might already be false; but if it's from IB, could this break things?
b) we should add a comment above the new line to explain why this is needed?

@metacodes
Copy link
Contributor Author

I wonder if

a) this may be too intrusive? If the view was assembled from code, this might already be false; but if it's from IB, could this break things? b) we should add a comment above the new line to explain why this is needed?

By default, the property is set to true for any view you programmatically create. If you add views in Interface Builder, the system automatically sets this property to false.https://developer.apple.com/documentation/uikit/uiview/1622572-translatesautoresizingmaskintoco

Although it's UIView, but it seems the same to NSView.

@metacodes metacodes deleted the patch-1 branch May 18, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants