Input loses focus after changing type attribute

UNCONFIRMED
Unassigned

Status

()

UNCONFIRMED
4 years ago
4 years ago

People

(Reporter: krzyzak, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

437 bytes, text/html
Details
(Reporter)

Description

4 years ago
Created attachment 8446499 [details]
bug.html

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:30.0) Gecko/20100101 Firefox/30.0 (Beta/Release)
Build ID: 20140605174243

Steps to reproduce:

Render input with type attribute set to text:
<input id="input1" type="text" name="test" value="10" />

Change it's type to number:
var input = window.document.getElementById('input1');
input.addEventListener('focus', function() {
    this.type = 'number';
});

Firefox 30, OSX Mavericks 10.9.3


Actual results:

When I press keyboard buttons nothing happens (I should be able to add numbers into input). I guess input is blurred, but no blur event is triggered.


Expected results:

When I press keyboard buttons text should appear inside input. Also blur event shouldn't happen and input should keep focus after changing it's type.

Open bug.html, focus input - when you press keyboard buttons nothing happens.

Updated

4 years ago
Component: Untriaged → DOM: Events
OS: Mac OS X → All
Product: Firefox → Core
Hardware: x86 → All
Version: 30 Branch → Trunk

Updated

4 years ago
Component: DOM: Events → Event Handling
You need to log in before you can comment on or make changes to this bug.