WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#33398 closed defect (bug) (fixed)

Feature detect best event to use on password fields

Reported by: peterwilsoncc Owned by: adamsilverstein
Milestone: 4.3.1 Priority: normal
Severity: normal Version: 4.3
Component: Users Keywords: has-patch commit fixed-major
Focuses: javascript, administration Cc:
PR Number:

Description

Following #33385 the user profile JavaScript uses keyup events to update the password strength meter and keep the password fields in sync.

Not all input methods update fire the keyup event so we use feature detection to detect the optimal event, I propose:

  • input
  • keyup
  • change

The optimal event to use is subjective and up for discussion.

Attachments (3)

33398.1.diff (1.9 KB) - added by peterwilsoncc 4 years ago.
33398.diff (2.1 KB) - added by adamsilverstein 4 years ago.
33398.2.diff (2.0 KB) - added by adamsilverstein 4 years ago.

Download all attachments as: .zip

Change History (17)

This ticket was mentioned in Slack in #core by chriscct7. View the logs.


4 years ago

#2 @peterwilsoncc
4 years ago

First pass in 33398.1.diff, went with input for preference, keyup as fallback. change as third fallback not needed, it has less support than keyup

#3 @peterwilsoncc
4 years ago

  • Keywords has-patch added; needs-patch removed

This ticket was mentioned in Slack in #core-passwords by sam. View the logs.


4 years ago

#6 @adamsilverstein
4 years ago

  • Keywords commit dev-feedback added
  • Owner set to adamsilverstein
  • Status changed from new to assigned

@petewilsoncc:

This looks great, I like your approach for detecting and using the correct method. I tested your patch and verified that it works and also that it resolves #33601.

33398.diff (sorry for mis-naming):

  • Refresh against trunk
  • Doc block cleanup, use @link for ticket reference, slight language change
  • Remove some extraneous newlines

This ticket was mentioned in Slack in #core-passwords by adamsilverstein. View the logs.


4 years ago

#8 @adamsilverstein
4 years ago

33398.2.diff:

  • Remove @link as per chat with @DrewAPicture

#9 @samuelsidler
4 years ago

  • Milestone changed from Awaiting Review to 4.3.1

Let's consider this for 4.3.1 since it appears to be the best way to fix #33601.

#10 @ocean90
4 years ago

#33601 was marked as a duplicate.

#11 @ocean90
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 34060:

Passwords: Refresh password fields when content is pasted into fields.

Use feature detection to determine whether password inputs should use the keyup or input event.

Props peterwilsoncc, adamsilverstein.
Fixes #33398.

#12 @ocean90
4 years ago

  • Keywords fixed-major added; dev-feedback removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

#13 @ocean90
4 years ago

  • Type changed from enhancement to defect (bug)

#14 @ocean90
4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 34078:

Passwords: Refresh password fields when content is pasted into fields.

Use feature detection to determine whether password inputs should use the keyup or input event.

Merge of [34060] to the 4.3 branch.

Props peterwilsoncc, adamsilverstein.
Fixes #33398.

Note: See TracTickets for help on using tickets.