Bug 542887 - Spinner on Mac should only allow numeric input as per Javadoc
Summary: Spinner on Mac should only allow numeric input as per Javadoc
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.8   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-12-18 05:56 EST by Justin Dolezy CLA
Modified: 2020-09-17 15:50 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.