Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 32951a7

Browse files
devversionThomasBurleson
authored andcommitted
fix(dialog): prefix dialog content probably
At the moment, the dialog always retrieved an id of `dialogContent_undefined` Fixes #7469. Closes #7480
1 parent 4a2c362 commit 32951a7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/dialog/dialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ function MdDialogProvider($$interimElementProvider) {
894894

895895
var role = (options.$type === 'alert') ? 'alertdialog' : 'dialog';
896896
var dialogContent = element.find('md-dialog-content');
897-
var dialogContentId = ('dialogContent_' + element.attr('id')) || ('dialogContent_' + $mdUtil.nextUid());
897+
var dialogContentId = 'dialogContent_' + (element.attr('id') || $mdUtil.nextUid());
898898

899899
element.attr({
900900
'role': role,

src/components/dialog/dialog.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ describe('$mdDialog', function() {
181181

182182
var dialog = parent.find('md-dialog');
183183
var content = parent[0].querySelector('md-dialog-content');
184-
185-
expect(content.id).toMatch(/dialogContent_.*/g);
184+
185+
expect(content.id).toMatch(/dialogContent_[0-9]+/g);
186186
}));
187187

188188
it('should remove `md-dialog-container` on mousedown mouseup and remove', inject(function($mdDialog, $rootScope, $timeout) {

0 commit comments

Comments
 (0)