Open mobile map button: fix since position sticky was unreliable on Safari

This commit is contained in:
Vesa Luusua 2017-08-25 12:18:59 +03:00
parent aaba33e8b3
commit 89b6c2a164
5 changed files with 6 additions and 13 deletions

View file

@ -6,7 +6,7 @@
}
.listingCards {
padding: 0 24px 30px 24px;
padding: 0 24px 96px 24px;
@media (--viewportMedium) {
display: flex;

View file

@ -20,7 +20,6 @@ const SearchResultsPanel = props => {
return (
<div className={classes}>
<div className={css.listingCards}>
{props.children}
{listings.map(l => (
<ListingCard
className={css.listingCard}
@ -29,6 +28,7 @@ const SearchResultsPanel = props => {
currencyConfig={currencyConfig}
/>
))}
{props.children}
</div>
{paginationLinks}
</div>

View file

@ -84,9 +84,10 @@
font-weight: var(--fontWeightSemiBold);
/* Positioning */
/* Safari didn't like bottom: 48px; -> hence calc from top */
/* Positioning from top to place button just above Safari's bottom toolbar
/* 120px = button height + toolbar height (68px) */
position: fixed;
top: calc(100vh - 100px);
top: calc(100vh - 120px);
left: 50vw;
width: 175px;
transform: translateX(-50%);
@ -121,11 +122,6 @@
}
}
.openMobileMapSticky {
position: sticky;
z-index: 1;
}
.mapPanel {
@media (--viewportMedium) {

View file

@ -270,9 +270,7 @@ export class SearchPageComponent extends Component {
search={searchParamsForPagination}
>
<div
className={classNames(css.openMobileMap, {
[css.openMobileMapSticky]: listings.length > 0,
})}
className={css.openMobileMap}
onClick={() => {
this.useLocationSearchBounds = true;
this.modalOpenedBoundsChange = true;

View file

@ -62,7 +62,6 @@ exports[`SearchPageComponent matches snapshot 1`] = `
rootClassName={null}
search={Object {}}>
<div
className=""
onClick={[Function]}>
<MapIcon
className={null} />