beeware / beeware/toga

on iOS on-screen keyboard covers multi-line input item, input is not visible

Open
#2,672 5 comments 0 reactions 0 assignees View on GitHub
bug iOS
Dominant language
Python
Stars
5.4k
Forks
827
Avg merge
15h 39m
Merged PRs (30d)
40

Description

### Describe the bug

I'm building a chat application. Below is sub that generates main window.
On Android (physical device) and on iPhone 7 (simulator), on iPhone 7 (simulator) works well.

On iPhone 7, SE, 15 (physical devices), SE (simulator) when cursor put into multiline input (self.text_input) - virtual keyboard appears and covers input item. So user has no visibility on entered text.

def create_conversation_ui(self):
self.chat = toga.WebView(
url=None,
style=Pack(flex=1),
)

# Buttons
self.text_input = toga.MultilineTextInput(
style=Pack(flex=1, padding=5),
placeholder='Type your',
value = ''
)
self.send_button = toga.Button(
"Send",
on_press=self.handle_send_button,
style=Pack(padding_top=5, padding_right=5),
)
share_feedback_button = toga.Button(
"Share feedback",
on_press=self.handle_share_feedback_button,
style=Pack(padding_top=5, padding_right=5),
)
new_chat_button = toga.Button(
"New chat",
on_press=self.handle_new_chat_button,
style=Pack(padding_top=5, padding_right=5),
)

buttons_box = toga.Box(
children=[self.send_button,
share_feedback_button,
new_chat_button,
toga.Label('id: ' + device_id, style=Pack(color=GRAY))],
style=Pack(direction=COLUMN),
)

input_box = toga.Box(
children=[self.text_input, buttons_box],
style=Pack(direction=ROW),
)

# Outermost box
outer_box = toga.Box(
children=[self.chat, input_box],
style=Pack(direction=COLUMN),
)

return outer_box

### Steps to reproduce

1. Build interface and run on iPhone 7, SE, 15
2. Go to 'Type your' multiline input text
3. See the issue

### Expected behavior

When cursor placed into multiline input and virtual keyboard displayed, application window either scrolls up or webview piece decreased in height so that user can wee both multiline text input and virtual keyboard.

### Screenshots

![IMG_9893](https://github.com/beeware/briefcase/assets/6624262/9bcd5ce8-1201-4597-be6b-906fcd71a050)
![IMG_9894](https://github.com/beeware/briefcase/assets/6624262/69621530-0bcc-4fcf-a204-8573dd35d7a2)
![IMG_9895](https://github.com/beeware/briefcase/assets/6624262/9087d7ba-4add-4ddc-a473-94875e8bb97f)
![IMG_9896](https://github.com/beeware/briefcase/assets/6624262/c246470e-a5be-4c6b-b9b5-33fa5fa3328b)

### Environment

- Operating System: iOS 17.5.1
- Python version: 3.12
- Software versions:
- Briefcase: 0.3.19
- Toga: 0.4.5

### Logs

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the create_conversation_ui entry point and the Toga MultilineTextInput used in the reproduced layout. Reproduce on the listed iOS devices or simulators, then trace the iOS keyboard and window-resizing behavior; done means the multiline input remains visible while the virtual keyboard is displayed.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, python
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.