Skip to content

onFocus and onBlur events on input elements cause issues #7421

@iam-peekay

Description

@iam-peekay

Do you want to request a feature or report a bug?
bug

What is the current behavior?
When I use onFocus or onBlur events on an <input> element in my React app, if in theonBlur or onFocus event handler I set the input's value to an empty string, I get:

TypeError·TypeError: property "value" is non-configurable and can't be delete OR
TypeError·Uncaught TypeError: Cannot delete property 'value' of #<HTMLInputElement>

Looking at the stack trace, it's because it is trying to delete the value and detach the onPropertyChange handler when onFocus or onBlur is called:

attachEvent("onpropertychange",d):A.addEventListener("propertychange",d,!1)}function f(){A&&(delete A.value,A.detachEvent?A.detachEvent("onpropertychange",d):A.removeEventListener("propertychange",d,!

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

react 15.1
All browsers

I frankly am not able to reproduce this locally on any browser, but we're seeing this error happen 1000s of times in our bug tracking system. I know this is probably not very helpful but I figured I can at least see if anyone else has run into this. Happy to close this issue if you feel there's not enough information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions