Fixed
Status Update
Comments
ae...@google.com <ae...@google.com>
ke...@google.com <ke...@google.com>
ap...@google.com <ap...@google.com> #2
I have the same problem. I hope this issue gets resolved quickly.
na...@google.com <na...@google.com> #3
I'm having the same problem, which makes this a dealbreaker for using it unfortunately.
lo...@gmail.com <lo...@gmail.com> #4
I have somewhat tracked down the issue here and https://issuetracker.google.com/268380384
In the other bug, the underlying popup is not set as focusable, so the keyboard opens. In alpha08 we have set the popup as focusable to intercept focus when the popup opens for A11y purposes. However it has the unintended consequence of intercepting ime actions, for some reason not passing them to child content despite the content (like textfield) still being focusable... Working on a solution.
In the other bug, the underlying popup is not set as focusable, so the keyboard opens. In alpha08 we have set the popup as focusable to intercept focus when the popup opens for A11y purposes. However it has the unintended consequence of intercepting ime actions, for some reason not passing them to child content despite the content (like textfield) still being focusable... Working on a solution.
ty...@gmail.com <ty...@gmail.com> #5
I find a way to make TextField editable for me. you can make a try.
ModalBottomSheet(/* .... */) {
// add follow code here to make your text filed edtable.
val view = LocalView.current.rootView.allViews
.filter { it.javaClass.name == "androidx.compose.ui.window.PopupLayout" }
.toList()
.first()
(view.context.getSystemService(Context.WINDOW_SERVICE) as WindowManager)
.updateViewLayout(view,
(view.layoutParams as WindowManager.LayoutParams).apply {
flags = flags and WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE.inv()
})
// your bottom sheet content code
TextField(/* ... */)
}
lo...@gmail.com <lo...@gmail.com> #6
Has anyone found any way to fix this?
Description
Jetpack Compose version: 2024.01.00
Jetpack Compose component(s) used:
RangeSlider
Android Studio Build: Build #AI-231.9392.1.2311.11330709, built on January 19, 2024
Kotlin version: 1.9.22
Material 3 version : 1.2.0-beta02
Steps to Reproduce or Code Sample to Reproduce:
RangeSlider
SliderRange
is failing therequire(isUnspecified || start <= endInclusive )
check on line 2120 due to rounding error as can be seen in the first line of the stack trace, wherestart
is only 0.00005 of a pixel greater than theendInclusive
Suggestion of a solution to fix this error
It is a known issue that floating point calculation is inherently imprecise in a sense that the resulting value is correct up to a specific decimal position. I suspect that the same is happening here when the start point and end point coordinates are being calculated. The
start
point may have gotten593.6667500000000000000000...
rounded to593.66675
andendInclusive
may have gotten593.66674999999999999999....
rounded to593.6667
.When doing floating point calculations for UI it is imperative to have a consistent cut off strategy for how many decimal places should be considered system-wise for rendering. In my experience 2 decimal places are ample for pixel-related arithmetics; anything beyond makes no visual difference.
So trim pixel values to only carry 2 decimal positions and discard everything from 3rd decimal position onwards. (Do NOT round the values!)
Following the strategy above system-wide for UI pixel-related arithmetics, will make sure that elusive errors like this do not happen.
Stack trace: