Bug 542887

Summary: Spinner on Mac should only allow numeric input as per Javadoc
Product: [Eclipse Project] Platform Reporter: Justin Dolezy <justin>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: lshanmug
Version: 4.8Keywords: triaged
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:

Description Justin Dolezy CLA 2018-12-18 05:56:18 EST
The Mac Spinner implementation seems to have lost filtering of non-numeric input so anything you type in is currently accepted. Should behave as the Windows implementation, where only numeric values (and appropriate locale symbols for minus, thousands separator..) are valid.

Steps to reproduce:

1. start IDE on a Mac
2. open the "SWT Controls" view
3. click in the spinner
4. type non-numeric characters and observe them appear in the spinner text field

I'm running High Sierra but I'm sure this issue occurs on older and newer MacOS versions.
Comment 1 Lakshmi P Shanmugam CLA 2018-12-20 02:12:47 EST
I don't think this is a regression, did it work with older versions of SWT on Mac?
I tested on Mac 10.13 and Eclipse 4.2, the behavior is same.
Comment 2 Justin Dolezy CLA 2020-09-17 15:50:52 EDT
OK technically not a regression then - I'd assumed it worked correctly at some point, so just a regular bug, and probably an old one at that :)

The Spinner javadoc says:

"Instances of this class are selectable user interface objects that allow the user to enter and modify numeric values."

The Windows implementation adheres to this, but not the Mac one.

We've got a patch on 4.8 that deals with this, busy here at the moment though, but once we jump to the latest release in a few months we'll submit an updated patch.