最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Angular-Material md-select in md-dialog - Stack Overflow

programmeradmin1浏览0评论

I have an angular material app in which I have a button that triggers a dialog box with a dropdown in it. If the button is at the top, everything works fine and as expected.

If the button is towards the bottom so the user has to scroll to get to it, however, once the dropdown is hit, the page jumps back to the top. The dialog box stays open at the bottom and I can't scroll down to it or click out of it, so I have to reload the page to do anything and the dialog box is useless.

If I use

<select ng-options="opt.val as opt.name for opt in options" ng-model="d"></select>

then it works fine.

But if I use a md-select

<md-select ng-model="d">
    <md-option ng-value="opt.val" ng-repeat="opt in options">{{opt.name}}</md-option>
</md-select>

then it breaks.

jsfiddle: /

If you scroll all the way to the bottom of the output, click a button, then try to open the dropdown, you can see the issue.

Is there any way to avoid this?

I have an angular material app in which I have a button that triggers a dialog box with a dropdown in it. If the button is at the top, everything works fine and as expected.

If the button is towards the bottom so the user has to scroll to get to it, however, once the dropdown is hit, the page jumps back to the top. The dialog box stays open at the bottom and I can't scroll down to it or click out of it, so I have to reload the page to do anything and the dialog box is useless.

If I use

<select ng-options="opt.val as opt.name for opt in options" ng-model="d"></select>

then it works fine.

But if I use a md-select

<md-select ng-model="d">
    <md-option ng-value="opt.val" ng-repeat="opt in options">{{opt.name}}</md-option>
</md-select>

then it breaks.

jsfiddle: https://jsfiddle/st3m3x0g/3/

If you scroll all the way to the bottom of the output, click a button, then try to open the dropdown, you can see the issue.

Is there any way to avoid this?

Share Improve this question asked Apr 10, 2015 at 21:27 yammeradeyammerade 6298 silver badges20 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

This functionality not working in angular material v0.9.8, actually i need a functionality on a dialog box when i click outside the box it should hide in v 0.9.8 of angular material.

This has been fixed in v0.9.0

See issue 1648 for further details.

发布评论

评论列表(0)

  1. 暂无评论