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

Commit

Permalink
fix(select): fix firefox select positioning, page moving on open
Browse files Browse the repository at this point in the history
closes #1648
  • Loading branch information
rschmukler committed Mar 17, 2015
1 parent a73c5c5 commit a15347c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/components/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -738,12 +738,12 @@ function SelectProvider($$interimElementProvider) {
selectNode = opts.selectEl[0],
contentNode = opts.contentEl[0],
parentRect = parentNode.getBoundingClientRect(),
targetRect = $mdUtil.clientRect(targetNode, parentNode),
targetRect = targetNode.getBoundingClientRect(),
shouldOpenAroundTarget = false,
bounds = {
left: parentNode.scrollLeft + SELECT_EDGE_MARGIN,
top: parentNode.scrollTop + SELECT_EDGE_MARGIN,
bottom: parentRect.height + parentNode.scrollTop - SELECT_EDGE_MARGIN,
left: parentRect.left + SELECT_EDGE_MARGIN,
top: SELECT_EDGE_MARGIN,
bottom: parentRect.height - SELECT_EDGE_MARGIN,
right: parentRect.width - SELECT_EDGE_MARGIN
},
spaceAvailable = {
Expand Down Expand Up @@ -850,14 +850,14 @@ function SelectProvider($$interimElementProvider) {
Math.min(targetRect.height / selectMenuRect.height, 1.0) +
')';

if (focusedNode) {
opts.focusedNode = focusedNode;
focusedNode.focus();
}

$$rAF(function() {
element.addClass('md-active');
selectNode.style[$mdConstant.CSS.TRANSFORM] = '';
if (focusedNode) {
opts.focusedNode = focusedNode;
focusedNode.focus();
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $select-container-transition-duration: 350ms;
$select-max-visible-options: 5;

.md-select-menu-container {
position: absolute;
position: fixed;
left: 0;
top: 0;
z-index: 99;
Expand Down

0 comments on commit a15347c

Please sign in to comment.