-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Typing into an Entry field will resize the layout which cannot be restored #2371
Comments
The video did not show this part... do you mean that the Append button disappears off the bottom of the screen, or that it will re-appear once the keyboard hides? I cannot think why this button is moving as we don't currently move layouts to accommodate keyboard (though we do need to). |
Thanks for the quick reply. I did not have a clear mind last night. :) Recreated the gif and updated it in the description as well: |
This is very strange indeed. I cannot replicate it on my Android devices. |
It is weird indeed. Description updated. Let me know if you need more information. |
I think this will be resolved by #566 in the "E" release planned. Marking as duplicate. |
I have noticed in android, with an entry that is bound to the bottom of the screen via a border layout, it does not "pop up" to the new bottom of the screen when the keyboard appears. The layout is like: content := container.NewVScroll(container.NewVBox())
entry := container.NewMax(widget.NewEntry())
container.New(
layout.NewBorderLayout(nil, entry, nil, nil),
entry,
content,
) I don't recall why I wrapped the entry in a max container tbh, but I don't think that's relevant to the behavior I'm describing. I would expect the VScroll to shrink, and the new bottom of the border layout to be just above the keyboard, but this doesn't happen for me. I assume this is going to be addressed in the same mobile keyboard changes that are going into 2.5, so I'm planning on just waiting to test that when it's ready, but I wanted to share this in case it's unexpected / new. |
A The behaviour that you describe is now landed on |
Ah thanks, this was some code from my early fyne-using days. Looks like I was using it to unnecessarily re-type some widgets into containers, funny thing to come across now. Great to hear, looking forward to the next release! |
Alright I got to building my app on It worked, with two caveats:
|
To your second point we were going to add "ScrollItemVisible" or similar, but I don't think it was added yet... |
Oh, what's this? It's not clear to me what this would do in this context. It's a bit tricky I expect, but my ideal situation would be for the scroll to ascend the height of the keyboard when the keyboard is displayed, then return down when it is hidden (regardless of if the scroll was at the bottom when the keyboard was popped up). This is all pretty specific to an entry that is bound to the bottom with a scroll above it, so if this takes a little extra work within the API that's not surprising to me. In order to do this with the API I'd need some way to hook into before and after the keyboard was present on screen (perhaps before and after the entry was focused), so that I could determine the difference in size of the scroll and adjust the position accordingly. As far as I can tell this isn't possible right now. |
I think the events available should be sufficient - the FocusGained and FocusLost on Entry should indicate if the keyboard is up or down. A very slight delay may be required but should not cause any issue visually. |
I was thinking I was going to need to run something immediately before and after the keyboard appeared, in order to tell how much the size of the scroll changed, but actually since this only matters on mobile, and the size of the window never changes on mobile, I should be able to do something like:
I'll give this a try relatively soon. It occurs to me now that multi-line entry growth also has this behavior, when an entry pinned at the bottom expands it occludes the scroll content. I'll try to apply a similar approach there. |
This probably relates to #3029 |
Following up here, I implemented a |
Perhaps worth opening a new issue to discuss that, the original issue is resolved in the release candidate. |
Describe the bug:
When typing into an "Entry" field, some widgets will be repositioned above the pop-up keyboard due to layout resizing. After the keyboard disappears, the resized layout is not restored. I have similar issues in another app which I am writing.
To Reproduce:
Steps to reproduce the behaviour:
fyne_demo
on an android devicefyne_demo
Data Binding
0.200000
and change it to any value e.g.1.2
Append
button moved above the keyboard and will stay there after the keyboard hides.Screenshots:
A short video.
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: