Bug 257989

Summary: Clearing of dirty for :user-invalid happens on wrong form event
Product: WebKit Reporter: Simon Welsh <simon>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ntim, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac (Intel)   
OS: macOS 12   
Attachments:
Description Flags
example.html none

Description Simon Welsh 2023-06-12 16:55:47 PDT
Created attachment 466673 [details]
example.html

When submitting a form with validation errors, the :user-invalid dirty state is reset. When resetting a form, it is not.

In the attached form, dirty the 'not-an-email' field with an invalid email address. The border will become red on blur.

If clicking the submit button, the form will fail validation but the red border will clear.

If clicking the reset button, the email field will return to its starting value but maintain the red border.


I'd expect these behaviours to be reversed. That is submitting a form does not clear the dirty tracking and resetting a form does.
Comment 1 Radar WebKit Bug Importer 2023-06-19 16:56:14 PDT
<rdar://problem/111014938>
Comment 2 Tim Nguyen (:ntim) 2023-08-07 20:55:34 PDT
I'll address this in bug 257988.

*** This bug has been marked as a duplicate of bug 257988 ***