Bug 257989 - Clearing of dirty for :user-invalid happens on wrong form event
Summary: Clearing of dirty for :user-invalid happens on wrong form event
Status: RESOLVED DUPLICATE of bug 257988
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Intel) macOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-06-12 16:55 PDT by Simon Welsh
Modified: 2023-08-07 20:55 PDT (History)
2 users (show)

See Also:


Attachments
example.html (494 bytes, text/html)
2023-06-12 16:55 PDT, Simon Welsh
no flags Details

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