question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TextInput.on_change does not seem to work

See original GitHub issue

Hello! I just started learning toga and played with tutorial “A slightly less toy example” and came across a problem. Please tell me, it’s a bug or I’m doing something wrong.

Expected Behavior

I added on_change handler to f_input: f_input.on_change = calculate. I expect that when you change the value in the field, the function calculate will be called.

Current Behavior

The function calculate is not called.

Your Environment

  • Python Version (list the specific version number) 3.5

  • Operating System and Version (select from the following and list the specific version number; if your OS is not listed, list that as well)

    • macOS - version:
    • Linux - distro: Mint - version: 18.3
    • Windows - version:
    • Other - name: - version:
  • Toga Target (the type of app you are trying to generate)

    • android
    • cocoa
    • django
    • gtk
    • iOS
    • tvOS
    • watchOS
    • winforms
    • win32
    • Other (please specify)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
freakboy3742commented, May 16, 2020

I think the credit for the full fix goes to @cachitas in acc206d; but I agree this is now fixed.

1reaction
DariusMontezcommented, May 14, 2020

It looks like @maranas resolved this issue back in Mar 2019 here by subscribing to the changed event of the native Gtk widget. From GTK Reference - the "changed" signal

I installed toga-0.3.0.dev20 this morning and am not experiencing this issue. My on_change handler is being fired on every keystroke or after a cut or a paste. Using this app with only a text input: (can be pasted directly into console)

import toga
def build(app):
    return toga.TextInput(on_change=print)

toga.App('app', 'app', startup=build).main_loop()
Read more comments on GitHub >

github_iconTop Results From Across the Web

TextInput React Native not working onChangeText
I have destructured it but it does not work unless I put the text inside the app return statement. It types one work...
Read more >
Solved: OnChange() of a textInput doesn't work when enter
Solved: Hi, I have a Text Input object. The "format" field is set to Number. If I am in the Text Input and...
Read more >
TextInput value can't be change during onChangeText [iOS]
TextInput's value property does not seem to get in sync when changing state via onChangeText. An example use case would be blocking non ......
Read more >
onchange event on lightning input tag in lwc fires but not ...
On the handler, i am trying to assign some value to a @track property which is referred on the for:each iterative to populate...
Read more >
How to Use TextInput Component to Change State in React ...
First, we need to use a component called “TextInput” , we need to import that at the top. The input field is just...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found