Skip to content
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

Self Styled modal in the template of react-pure-modal #51

Open
Mortuie opened this issue Jan 12, 2021 · 11 comments
Open

Self Styled modal in the template of react-pure-modal #51

Mortuie opened this issue Jan 12, 2021 · 11 comments

Comments

@Mortuie
Copy link

Mortuie commented Jan 12, 2021

image

I was wondering if anyone else had come up with a similar issue, when styling/using a modal. The highlighted area in blue signifies where the mozilla firefox url bar goes. This is on an android mobile phone using Mozilla Firefox.

When i then scroll up on the modal itself the url bar appears. The styling I have used is inspired by the styling for the react pure modal components.

@max-mykhailenko
Copy link
Member

Do you have the same problem on a demo page?
https://memcrab.github.io/react-pure-modal/

@Mortuie
Copy link
Author

Mortuie commented Jan 13, 2021

No however the actual demo page isn't scrollable, whereas the url bar only disappears on firefox when the page is scrollable. when I say page I mean the page where all your buttons are i.e. "open scrollable modal....." etc...

I tried using most of your css for the backdrop & modal which is of the form:

const Backdrop = styled.div`
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
`;

const ModalContainer = styled.div`
  transform: translate(0px, 0px);
  transition: none 0s ease 0s;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  max-height: 100%;
  min-height: 100%;
  z-index: 1041;
  background-color: white;
`;

And then the react setup is

<Backdrop onClick={() => setModal(false)}>
        <ModalContainer
          onClick={e => {
            e.stopPropagation();
            e.preventDefault();
          }}
        >
          <input placeholder="HERE" />
        </ModalContainer>
      </Backdrop>

i've tried playing around with autofocus on the input but that doesn't seem to change anything do you have any idea?

@max-mykhailenko
Copy link
Member

I added to the actual example 150vh body height. Did you see the same problems in example?

@Mortuie
Copy link
Author

Mortuie commented Jan 27, 2021

@max-mykhailenko yup similar behaviour :O

@max-mykhailenko
Copy link
Member

I'm finally detect it. So problem happens when modal contains input and keyboard is opened. Body in this case has additional undetectable bottom margin/padding.

@Mortuie
Copy link
Author

Mortuie commented Jan 29, 2021

What do you mean by the "body" and also have you thought of a solution ? Do you have discord and we can maybe have a chat about this solution?

@max-mykhailenko
Copy link
Member

body as tag

You can send PR or my team will check this problem when will have time.

@Mortuie
Copy link
Author

Mortuie commented Jan 29, 2021

ok i will have a look in a second

@Mortuie
Copy link
Author

Mortuie commented Feb 5, 2021

Are you talking about setting body, html to 0 i.e.

body, html {
    margin: 0;
    padding: 0;
}

@max-mykhailenko
Copy link
Member

Are you talking about setting body, html to 0 i.e.

body, html {
    margin: 0;
    padding: 0;
}

As I saw, it doesn't help

@Mortuie
Copy link
Author

Mortuie commented Feb 5, 2021

I still can't really find a way of preventing / solving this issue, so if you have any thoughts feel free @max-mykhailenko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants