Alexander Maryanovsky
06/09/2022, 10:30 AMModifier.scroll
seems to automatically keep the focused element in view. Very nice.Zach Klippenstein (he/him) [MOD]
06/09/2022, 3:18 PMAlexander Maryanovsky
06/09/2022, 8:05 PMZach Klippenstein (he/him) [MOD]
06/10/2022, 12:29 AMBringIntoViewRequester
and make the request on focus with a larger rect than the size of the field. I havenāt tried that but i think it should workAlexander Maryanovsky
06/11/2022, 3:39 PMBringIntoViewResponder
not in compose-desktop yet? It seems like the better way to go is to implement BringIntoViewResponder.calculateRectForParent
to return a slightly larger rect.Alexander Maryanovsky
06/11/2022, 3:42 PMBringIntoViewResponder
but not Modifier.bringIntoViewResponder
Alexander Maryanovsky
06/13/2022, 9:23 AMBringIntoViewRequester
doesnāt work, because the ābuilt-inā mechanism calls scrollableState.animateScrollBy
immediately after my BringIntoViewRequester
does so, which overrides my scroll request.Alexander Maryanovsky
06/13/2022, 9:25 AMdelay(1)
before calling bringIntoViewRequester.bringIntoView
Zach Klippenstein (he/him) [MOD]
06/13/2022, 3:30 PMAlexander Maryanovsky
06/13/2022, 7:48 PM.onGloballyPositioned {
layoutCoords = it
}
.bringIntoViewRequester(bringIntoViewRequester)
.onFocusChanged {
if (it.isFocused) {
layoutCoords?.size?.let { size ->
coroutineScope.launch {
delay(1)
val rect = size.toSize().toRect()
val targetRect = rect.copy(top = <http://rect.top|rect.top> - 20, bottom = rect.bottom + 20)
bringIntoViewRequester.bringIntoView(targetRect)
}
}
}
}
Alexander Maryanovsky
06/13/2022, 7:53 PMBringIntoViewResponder.performBringIntoView
and itās called twice - once from my call (with the correct rect) and once from somewhere else (with the default rect).Alexander Maryanovsky
06/13/2022, 7:53 PMscrollableState.animateScrollBy(offset.reverseIfNeeded())
itās not surprising that the 2nd call ācancelsā the first call.Zach Klippenstein (he/him) [MOD]
06/13/2022, 7:58 PMAlexander Maryanovsky
06/13/2022, 9:00 PMid("org.jetbrains.compose") version "1.1.1"
Zach Klippenstein (he/him) [MOD]
06/18/2022, 1:24 AM