Bug 254077 - HTML input textbox with type=number is not returning correct value when decimal is entered
Summary: HTML input textbox with type=number is not returning correct value when decim...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: Safari 16
Hardware: iPhone / iPad iOS 16
: P2 Critical
Assignee: Ahmad Saleem
URL:
Keywords: InRadar
: 254109 258027 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-03-17 08:11 PDT by Prakash Kumar
Modified: 2023-09-02 03:26 PDT (History)
6 users (show)

See Also:


Attachments
Simple HTML page to demonstrate the issue (427 bytes, text/html)
2023-03-17 08:11 PDT, Prakash Kumar
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Prakash Kumar 2023-03-17 08:11:13 PDT
Created attachment 465478 [details]
Simple HTML page to demonstrate the issue

The value of textbox is returned as empty string when the user entered valid input with decimal point.

User entered "1" ==> Output "1"
User entered "1." ==> Output "" (This is wrong. It should have returned "1")
User entered "1.2" ==> Output "1.1"

Attached a simple HTML page. Please try entering "1.2" and see the value printed below the textbox.

Same index.html we tried in IOS application which is compiled Xcode 14.1 having same issue. Same app with this index.html, if we compile in Xcode 13.0, this issue is not replicable.
Comment 1 Prakash Kumar 2023-03-17 08:14:42 PDT
Typo corrected

Simple HTML page to demonstrate the issue

The value of textbox is returned as empty string when the user entered valid input with decimal point.

User entered "1" ==> Output "1"
User entered "1." ==> Output "" (This is wrong. It should have returned "1")
User entered "1.2" ==> Output "1.2"

Attached a simple HTML page. Please try entering "1.2" and see the value printed below the textbox.

Same index.html we tried in IOS application which is compiled Xcode 14.1 having same issue. Same app with this index.html, if we compile in Xcode 13.0, this issue is not replicable.
Comment 2 Prakash Kumar 2023-03-17 08:21:34 PDT
Exact version where we replicated the issue

MAC OS version: 13.2.1 Ventura
MAC Safari version : Version 16.3 (18614.4.6.1.6)

Iphone IOS version : ios16.1 (20B72)
Comment 3 Alexey Proskuryakov 2023-03-19 21:33:20 PDT
*** Bug 254109 has been marked as a duplicate of this bug. ***
Comment 4 Radar WebKit Bug Importer 2023-03-24 08:12:17 PDT
<rdar://problem/107187010>
Comment 5 Ahmad Saleem 2023-09-01 18:24:36 PDT
Merging following make us pass following test case: https://chromium.googlesource.com/chromium/src.git/+/040a94e06971c4272408375ea1cffe1aeae2a316

Will do PR later. :-)

Assigning to myself.
Comment 6 Ahmad Saleem 2023-09-01 18:49:07 PDT
Draft PR: https://github.com/WebKit/WebKit/pull/17367
Comment 7 Ahmad Saleem 2023-09-02 02:51:14 PDT
*** Bug 258027 has been marked as a duplicate of this bug. ***
Comment 8 EWS 2023-09-02 03:26:00 PDT
Committed 267581@main (4835336f30b5): <https://commits.webkit.org/267581@main>

Reviewed commits have been landed. Closing PR #17367 and removing active labels.