Skip to content

[MdButton] click on button throws exception in IE11 #1966

Open
@ajdalshov

Description

@ajdalshov

Steps to reproduce

Click a MdButton that has ripple effect

Which browser?

Tested with:
Win7 / IE11 (11.0.9600.19102)
Win7 / IE11 (11.0.9600.19155)
Win10 / IE11 (11.345.17134.0)

What is expected?

Button ripple effect should work and no exception should occur when clicking a button

What is actually happening?

[Vue warn]: Error in callback for watcher "mdActive": "TypeError: Unable to get property '1' of undefined or null reference"

found in

---> <MdRipple> at src/components/MdRipple/MdRipple.vue
       <MdButtonContent> at src/components/MdButton/MdButtonContent.vue
         <MdButton> at src/components/MdButton/MdButton.vue
[...]

The error can be traced back to line 55 in src/components/MdRipple/MdRipple.vue

const isEvent = active.constructor.toString().match(/function (\w*)/)[1].toLowerCase() === 'mouseevent'

What happens is that active.constructor.toString() returns

using IE11:

[object MouseEvent]

using Chrome:

function MouseEvent() { [native code] }

...meaning that the regex inside the match() method will fail and return null on IE11.

The impact is that exception is thrown in dev console and that the ripple effect does not show in IE11.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions