Closed abhiomkar closed 4 years ago
This issue only seems to happen the first time the menu is opened on the initial load of the Catalog page.
The second time the menu is opened, it is positioned correctly. Reloading the page also causes the menu to be positioned properly on first open.
The only way to repro the misalignment is to open a new browser tab, navigate to the Catalog page, and interact with an Enhanced Select:
AFAICT, this issue is not present on any of our screenshot test pages.
It might be a bug in the Catalog site (something something caching?).
could it be the body scroll bars that in some cases are adding to the "left" and in some cases not (like in your test case pages)...
I'm actually not able to reproduce this issue in an isolated setting, or in the screenshot tests. I think its just our catalog pages. I'm going to transfer this issue to the catalog.
This is what I used to try to reproduce:
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css">
<body>
<div class="mdc-select" id='select'>
<input type="hidden" name="enhanced-select">
<i class="mdc-select__dropdown-icon"></i>
<div class="mdc-select__selected-text"></div>
<div class="mdc-select__menu mdc-menu mdc-menu-surface">
<ul class="mdc-list">
<li class="mdc-list-item mdc-list-item--selected" data-value="" aria-selected="true"></li>
<li class="mdc-list-item" data-value="grains">
Bread, Cereal, Rice, and Pasta
</li>
<li class="mdc-list-item" data-value="vegetables">
Vegetables
</li>
<li class="mdc-list-item" data-value="fruit">
Fruit
</li>
</ul>
</div>
<span class="mdc-floating-label">Pick a Food Group</span>
<div class="mdc-line-ripple"></div>
</div>
<script src="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.js"></script>
<script>
mdc.select.MDCSelect.attachTo(document.getElementById('select'));
</script>
</body>
</html>
Fixed!
Version
v0.44.1
Actual
Expected
Dropdown is aligned as expected when opened second time.