mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
ScrollView: Do not change offset in directionless focus change
This commit is contained in:
parent
9e804fd105
commit
b75b5017e1
@ -370,10 +370,13 @@ where
|
|||||||
fn take_focus(&mut self, source: Direction) -> bool {
|
fn take_focus(&mut self, source: Direction) -> bool {
|
||||||
// If the inner view takes focus, re-align the important area.
|
// If the inner view takes focus, re-align the important area.
|
||||||
if self.inner.take_focus(source) {
|
if self.inner.take_focus(source) {
|
||||||
self.scroll_to_important_area();
|
// Don't do anything if we come from `None`
|
||||||
|
if source != Direction::none() {
|
||||||
|
self.scroll_to_important_area();
|
||||||
|
|
||||||
// Note: we can't really return an `EventResult` here :(
|
// Note: we can't really return an `EventResult` here :(
|
||||||
self.on_scroll_callback();
|
self.on_scroll_callback();
|
||||||
|
}
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
self.core.is_scrolling().any()
|
self.core.is_scrolling().any()
|
||||||
|
Loading…
Reference in New Issue
Block a user