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

Commit a15347c

Browse files
committed
fix(select): fix firefox select positioning, page moving on open
closes #1648
1 parent a73c5c5 commit a15347c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/components/select/select.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -738,12 +738,12 @@ function SelectProvider($$interimElementProvider) {
738738
selectNode = opts.selectEl[0],
739739
contentNode = opts.contentEl[0],
740740
parentRect = parentNode.getBoundingClientRect(),
741-
targetRect = $mdUtil.clientRect(targetNode, parentNode),
741+
targetRect = targetNode.getBoundingClientRect(),
742742
shouldOpenAroundTarget = false,
743743
bounds = {
744-
left: parentNode.scrollLeft + SELECT_EDGE_MARGIN,
745-
top: parentNode.scrollTop + SELECT_EDGE_MARGIN,
746-
bottom: parentRect.height + parentNode.scrollTop - SELECT_EDGE_MARGIN,
744+
left: parentRect.left + SELECT_EDGE_MARGIN,
745+
top: SELECT_EDGE_MARGIN,
746+
bottom: parentRect.height - SELECT_EDGE_MARGIN,
747747
right: parentRect.width - SELECT_EDGE_MARGIN
748748
},
749749
spaceAvailable = {
@@ -850,14 +850,14 @@ function SelectProvider($$interimElementProvider) {
850850
Math.min(targetRect.height / selectMenuRect.height, 1.0) +
851851
')';
852852

853-
if (focusedNode) {
854-
opts.focusedNode = focusedNode;
855-
focusedNode.focus();
856-
}
857853

858854
$$rAF(function() {
859855
element.addClass('md-active');
860856
selectNode.style[$mdConstant.CSS.TRANSFORM] = '';
857+
if (focusedNode) {
858+
opts.focusedNode = focusedNode;
859+
focusedNode.focus();
860+
}
861861
});
862862
}
863863

src/components/select/select.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $select-container-transition-duration: 350ms;
66
$select-max-visible-options: 5;
77

88
.md-select-menu-container {
9-
position: absolute;
9+
position: fixed;
1010
left: 0;
1111
top: 0;
1212
z-index: 99;

0 commit comments

Comments
 (0)