Bug 254077

Summary: HTML input textbox with type=number is not returning correct value when decimal is entered
Product: WebKit Reporter: Prakash Kumar <prakashkumar.cse>
Component: UI EventsAssignee: Ahmad Saleem <ahmad.saleem792>
Status: RESOLVED FIXED    
Severity: Critical CC: ahmad.saleem792, akeerthi, karthikeyan.velayudam, prakash.kumar.balu, tom.hilton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: iPhone / iPad   
OS: iOS 16   
Attachments:
Description Flags
Simple HTML page to demonstrate the issue none

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.