Skip to content

Adding new data when rememberChartScrollSpec(initialScroll = InitialScroll.End) #325

Closed Answered by makaronis
makaronis asked this question in Questions
Discussion options

You must be logged in to vote
scrollState.registerScrollListener(object : ScrollListener {
        override fun onMaxValueChanged(oldMaxValue: Float, newMaxValue: Float) {
            val diffValue = newMaxValue - oldMaxValue
            if (diffValue > 0) {
                diff.value = diffValue
            }
        }
    })
    LaunchedEffect(diff.value) {
        if (diff.value > 0) {
            scrollState.scroll(MutatePriority.PreventUserInput) {
                this.scrollBy(diff.value)
            }
        }
    }

this code almost solves my problem, but AutoScrollCondition.OnModelSizeIncreased don't

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@makaronis
Comment options

@patrickmichalik
Comment options

@makaronis
Comment options

@makaronis
Comment options

Answer selected by makaronis
@patrickmichalik
Comment options

@makaronis
Comment options

@patrickmichalik
Comment options

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