Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#33385 closed defect (bug) (fixed)

Unable to create users in IE8

Reported by: pento's profile pento Owned by: obenland's profile obenland
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.3
Component: Users Keywords: has-patch commit
Focuses: javascript, administration Cc:

Description

To reproduce:

  • Navigate to /user-new.php in IE8 as an admin
  • Enter a new username
  • Enter a new e-mail address
  • Click "Add New User"

This results in the following errors:

ERROR: Please enter your password twice.

ERROR: Please enter the same password in the two password fields.

The same errors occur if you enter a custom password, or a custom weak password.

Attachments (5)

33385.1.diff (1.5 KB) - added by peterwilsoncc 9 years ago.
33385.diff (2.7 KB) - added by adamsilverstein 9 years ago.
33385.2.diff (2.7 KB) - added by adamsilverstein 9 years ago.
try #2
33385.3.diff (1.5 KB) - added by adamsilverstein 9 years ago.
js only version of patch
33385.4.diff (1.7 KB) - added by adamsilverstein 9 years ago.

Download all attachments as: .zip

Change History (19)

#1 @pento
9 years ago

Confirmed that IE9+ works correctly.

#2 @obenland
9 years ago

Could this be related to #32886? @adamsilverstein, @markjaquith, do you have time to look into it?

#3 follow-up: @peterwilsoncc
9 years ago

propertychange (IE8) fires on programatic changes, input does not.

IE8 appears to be looping events and clearing pass2 in the event following the lastpass comment. This causes a password mismatch.

In 33385.1.diff events are fired on the keypress event. It fixes the IE8 password mismatch but introduces a lag/stickiness with the strength meter status not changing immediately.

Needs iteration but I need to sign off now, I am afraid.

#4 @MikeHansenMe
9 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

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


9 years ago

#6 in reply to: ↑ 3 @adamsilverstein
9 years ago

Good catch, I think I understand what was happening here with 'propertychange' which we were using to capture input in ie8.

I tried your patch in ie and and the only issue I still see is the delay in updating the password strength meter you mentioned.

Changing the method from keypress to keyup seems to have alleviated that to some degree, I'm still seeing an empty strength meter if i clear the password field in ie. I'm going to keep digging here to see if I can refine further.


Replying to peterwilsoncc:

propertychange (IE8) fires on programatic changes, input does not.

IE8 appears to be looping events and clearing pass2 in the event following the lastpass comment. This causes a password mismatch.

In 33385.1.diff events are fired on the keypress event. It fixes the IE8 password mismatch but introduces a lag/stickiness with the strength meter status not changing immediately.

Needs iteration but I need to sign off now, I am afraid.

@adamsilverstein
9 years ago

try #2

#7 @adamsilverstein
9 years ago

  • Keywords dev-feedback added; needs-testing removed

In 33385.2.diff:

  • Bind to keyup event, verified fires correctly across browsers (unlike keypress, fires after input value changes)
  • Added the ie8 equivalent css filter matching our opacity settings for the password strength meter.

Note: Because the password meter uses inline styles overriding the display attribute, we are using opacity here to hide the password meter when the password field is blank. This doesn't work in ie8 where opacity isn't fully supported - so you just get a blank box for the password meter. My patch includes a css filter that works in ie8, tested and it works correctly. An untested solution would involve a wrapper element that we could show/hide, not certain would even work though. Another option would be to leave the box as is for ie8, it looks like this:

http://cl.ly/image/2W412R0Z1R0r/Dashboard_2015-08-17_11-32-42.jpg

#8 @adamsilverstein
9 years ago

Note: also tested with LastPass, verified working correctly.

@adamsilverstein
9 years ago

js only version of patch

#9 @obenland
9 years ago

  • Owner set to obenland
  • Status changed from new to accepted

#10 @adamsilverstein
9 years ago

33385.4.diff:

  • Also address an issue with the cursor jumping to the end of the field when you edit the plaintext password.

#11 @wonderboymusic
9 years ago

.4.diff looks fine but $('#pass2').on( ... doesn't have to change - for the sake of fixing the ticket, who cares, but it general...

#12 @azaozz
9 years ago

  • Keywords commit added; dev-feedback removed

Looks good here too.

Yeah, $pass2 = $('#pass2').on( ... doesn't need to change, just a bit better readability :)

#13 @obenland
9 years ago

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

In 33625:

Passwords: Use keyup event to prevent IE8's misinterpretation of propertychange.

Props adamsilverstein, peterwilsoncc.
Fixes #33385.

#14 @magicroundabout
9 years ago

This breaks pasting functionality in some other places. You undid #31226. I've raised #33601 about not being able to paste a password into the field in iOS.

Note: See TracTickets for help on using tickets.