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

Possible regression between 1.4.0 and 1.4.1 in popupBarItems #21

Closed
michaelschwinges opened this issue Mar 1, 2023 · 4 comments
Closed

Comments

@michaelschwinges
Copy link

Describe the Bug

When updating LNPopupView from 1.4.0 to 1.4.1, then the frame of popupBarItems' Button moves around.

To Reproduce

Change SPM from exact version 1.4.0 to exact version 1.4.1, then the behaviour manifests itself.

Expected Behavior

I guess I would expect the LoadingSpinnerView which is the button's content not to shift around like it does - while there is a rotation modifier on a view within that view, it does not contain anything that changes position or frame size. My workaround for now will be to stay on 1.4.0 but this isn't viable for when I ship, as LNPopupUI is maintained and will change and fix and improve over time leaving me behind.

Screenshots

Behaviour on 1.4.0:

Before.mov

Behaviour on 1.4.1:

After.mov

Additional Context

I am changing the button's content when the play state changes as follows:

.popupBarItems({
    Button(action: {
        playerViewModel.togglePlaying()
    }) {
         if playerViewModel.playerState == .loading {
            LoadingSpinnerView()
                 .frame(width: 35, height: 35)
                 .accentColor(.primary)
                 .padding(2)
                 .border(.pink)
        } else if playerViewModel.playbackState == .stopped || playerViewModel.playbackState == .paused {
            Image(systemName: "play.fill")
                .renderingMode(.template)
                .foregroundColor(.primary)
                .font(.title2)
                .padding(10)
        } else if playerViewModel.playbackState == .playing {
            Image(systemName: "pause.fill")
                .renderingMode(.template)
                .foregroundColor(.primary)
                .font(.title2)
                .padding(10)
        }
    }
})
@LeoNatan
Copy link
Owner

I will take a look soon. Sorry for the delay!

@LeoNatan
Copy link
Owner

Could you please post the source for LoadingSpinnerView, or a self-contained example, where this issue reproduces? Thanks

@LeoNatan
Copy link
Owner

Ping @michaelschwinges

@LeoNatan
Copy link
Owner

Closing this issue. If you post the example project, I’ll reopen and look into it.

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

No branches or pull requests

2 participants