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

Change positionPercentage API of just created SplitPaneState. #3973

Closed
vdshb opened this issue Nov 25, 2023 · 3 comments
Closed

Change positionPercentage API of just created SplitPaneState. #3973

vdshb opened this issue Nov 25, 2023 · 3 comments
Labels
bug Something isn't working desktop

Comments

@vdshb
Copy link
Contributor

vdshb commented Nov 25, 2023

Describe the bug

I need to change positionPercentage of just created SplitPaneState.

Long story short, recreating SplitPaneState is not an option in my architecture. Use it in SplitPane just to calculate internal minPosition and maxPosition is a poor option as well.

Affected platforms

  • Desktop

Reproducer

import org.jetbrains.compose.splitpane.SplitPaneState

fun main() {
    val splitPaneState = SplitPaneState(0.6f, true)
    splitPaneState.dispatchRawMovement(0.2f)
    println(splitPaneState.positionPercentage)  // prints "NaN"
}

Expected behavior
Some API supposed to be available to change/reset positionPercentage of already created but not yet used SplitPaneState.

Expected behavior
API are internal or buggy until put SplitPaneState into SplitPane.

@vdshb vdshb added bug Something isn't working submitted labels Nov 25, 2023
@vdshb
Copy link
Contributor Author

vdshb commented Nov 25, 2023

I've added #3974. It solves this issue.

@vdshb
Copy link
Contributor Author

vdshb commented Jun 17, 2024

Fixed in #3974

@vdshb vdshb closed this as completed Jun 17, 2024
@okushnikov
Copy link

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working desktop
Projects
None yet
Development

No branches or pull requests

3 participants