Skip to content

Fix: Search box doesn't fit in overlays on mobile using MediaQuery Tag #2434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
8 changes: 7 additions & 1 deletion client/modules/App/components/Overlay.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import { withTranslation } from 'react-i18next';
import MediaQuery from 'react-responsive';

import browserHistory from '../../../browserHistory';
import ExitIcon from '../../../images/exit.svg';
Expand Down Expand Up @@ -69,7 +70,7 @@ class Overlay extends React.Component {
<header className="overlay__header">
<h2 className="overlay__title">{title}</h2>
<div className="overlay__actions">
{actions}
<MediaQuery query="(min-width: 768px)">{actions}</MediaQuery>
<button
className="overlay__close-button"
onClick={this.close}
Expand All @@ -79,6 +80,11 @@ class Overlay extends React.Component {
</button>
</div>
</header>
<MediaQuery query="(max-width: 767px)">
{actions && (
<div className="overlay__actions-mobile">{actions}</div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's a some left padding to this new CSS class. This will align it with the QuickAddWrapper.

.overlay__actions-mobile {
  padding-left: #{24/ $base-font-size}rem;
}

(I know I said in the issue not to worry about padding, but seeing it in action...I've changed my mind 😝)

image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so do you want me run git revert 8c8dfa16c4ad9ddb7d9522ee9add70de9d5d6363 and push again..?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or else do i need to do any changes?

)}
</MediaQuery>
{children}
<DocumentKeyDown handlers={{ escape: () => this.close() }} />
</section>
Expand Down