From 8f5f2503474a970a4e5be0bc1fa7694110cf1e94 Mon Sep 17 00:00:00 2001 From: samschott Date: Mon, 30 Jan 2023 00:06:32 +0100 Subject: [PATCH 1/2] fix accessing the impl layer from TogaStepper --- cocoa/src/toga_cocoa/widgets/numberinput.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocoa/src/toga_cocoa/widgets/numberinput.py b/cocoa/src/toga_cocoa/widgets/numberinput.py index 59bd80d44c..a56c09e0b8 100644 --- a/cocoa/src/toga_cocoa/widgets/numberinput.py +++ b/cocoa/src/toga_cocoa/widgets/numberinput.py @@ -39,7 +39,7 @@ def onChange_(self, stepper) -> None: @objc_method def controlTextDidChange_(self, notification) -> None: try: - value = str(self._impl.input.stringValue) + value = str(self.impl.input.stringValue) # Try to convert to a decimal. If the value isn't a number, # this will raise InvalidOperation Decimal(value) From 596f46cf384e949de1859406a2fcdedfa53ccc19 Mon Sep 17 00:00:00 2001 From: samschott Date: Mon, 30 Jan 2023 00:07:56 +0100 Subject: [PATCH 2/2] update changelog --- changes/1757.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/1757.bugfix.rst diff --git a/changes/1757.bugfix.rst b/changes/1757.bugfix.rst new file mode 100644 index 0000000000..bd0196e2d0 --- /dev/null +++ b/changes/1757.bugfix.rst @@ -0,0 +1 @@ +Fix updating the value and calling on_change for NumberInput widgets in Cococa.