material icon indicating copy to clipboard operation
material copied to clipboard

Calling $mdDialog.hide with an empty string resolves to the string 'true'

Open ddimitrop opened this issue 11 years ago • 2 comments

See codepen

http://codepen.io/anon/pen/oXOyjz

Problem at line:

https://github.com/angular/material/blob/6fd31c9a9fef9a6bda099883fd104a186d9b36dd/src/core/services/interimElement/interimElement.js#L301

If 'reason' (which is the value returned by the dialog) is empty, the expression remove(reason || SHOW_CLOSED, false) passes SHOW_CLOSED (='true') to the caller.

ddimitrop avatar Aug 14 '15 02:08 ddimitrop

@ThomasBurleson Looks like this came from your batch of dialog changes.

jelbourn avatar Aug 14 '15 02:08 jelbourn

It also resolves to boolean true if you call hide() with a boolean false as in $mdDialog.hide(false). My current workaround is passing boolean values as strings, e.g. $mdDialog.hide('false').

jaymanned avatar Sep 30 '15 21:09 jaymanned