Skip to content
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

iOS dark mode: multiline input text is not visible #2671

Open
skrupenin opened this issue Jun 20, 2024 · 1 comment
Open

iOS dark mode: multiline input text is not visible #2671

skrupenin opened this issue Jun 20, 2024 · 1 comment
Labels
bug A crash or error in behavior. iOS The issue relates to Apple iOS mobile support.

Comments

@skrupenin
Copy link

skrupenin commented Jun 20, 2024

Describe the bug

I'm building a chat application. Below is sub that generates main window.

On iPhone 7, SE, 15 in dark mode (physical devices) entered text is not visible: background is black and text color is black.

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 in dark mode
  2. Go to 'Type your' multiline input text
  3. Type some text
  4. Text is not visible - issue

Expected behavior

Text is displayed in light color - white

Screenshots

IMG_9897
IMG_9899
Screenshot 2024-06-21 at 01 37 12

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

@skrupenin skrupenin added the bug A crash or error in behavior. label Jun 20, 2024
@freakboy3742 freakboy3742 added the iOS The issue relates to Apple iOS mobile support. label Jun 21, 2024
@freakboy3742 freakboy3742 transferred this issue from beeware/briefcase Jun 21, 2024
@freakboy3742
Copy link
Member

Thanks for the report. I've moved this to the Toga repository, because integration with dark mode isn't something that Briefcase controls - it's a Toga issue.

Unfortunately, I can't reproduce what you're describing. This might be because I can't work out what your example code is trying to do - it doesn't have a main window, and it references a "device ID", so it can't be used as is; and it contains a number of details that don't appear to have anything to do with a MultilineTextInput, so it's not clear if the issue is the interaction between widgets, or if it's with a single widget. It's also not clear how I'm meant to be interpreting the screenshots, because they seem to be substantially redacted, hiding all the useful details, in favour of large overlays of text repeating what the report is telling me.

If I create an app that only has a MultilineTextInput, it renders white text on black background when in dark mode. Toga isn't doing anything to alter the default colors, so I'm not sure how you'd be getting different behavior.

If you're able to provide a minimal reproduction case (i.e., a full app that only contains the code needed to reproduce the issue, I can take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. iOS The issue relates to Apple iOS mobile support.
Projects
None yet
Development

No branches or pull requests

2 participants