question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slider does't allow next elements in a row to be displayed

See original GitHub issue

Any element in a row after slider gets effectively zero space. Not 100% sure, but seems that’s what also mentioned in #1484 comments. Effective on compose-jb 1.0.1.

In below example, second button isn’t visible at all.

@Composable
@Preview
fun TestSlider() {
    Box {
        Row {
            Button(
                onClick = {

                }
            ) {
                Text("Process")
            }
            Slider(
                value = 0f,
                valueRange = 0f..1f,
                onValueChange = {

                },
            )
            Button(
                onClick = {

                }
            ) {
                Text("Terminate")
            }
        }
    }
}

Slider

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
igordmncommented, Feb 14, 2022

You need to add Modifier.weight(1f):

Slider(
    value = 0f,
    valueRange = 0f..1f,
    onValueChange = {

    },
    modifier = Modifier.weight(1f)
)

see explanation here

1reaction
akurasovcommented, Jan 31, 2022

Reproduced. Same problem on Android. Should be reported to Google

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS inline-block not working in slider list - Stack Overflow
I am trying to make it so that the div.slider-box > ul > li elements are displayed inline-block out of sight, behind the...
Read more >
Episode 5: Carousel with multiple elements visible - markup
In this type of slider, we have multiple elements within the carousel that slide using our next and prev buttons.
Read more >
Slider Revolution Changelog
One click of a button will update the Slider Revolution WordPress Builder to the latest available version, directly from our update servers.
Read more >
ARIA: slider role - Accessibility - MDN Web Docs
The slider role defines an input where the user selects a value from within a given range.
Read more >
Options - Splide
Converts the image src to the css background-image URL of the parent element. slideFocus. Determines whether to add tabindex="0" to visible slides or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found