Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
Window resize event is not triggered on closing the keypad or Bottom address bar in ios browsers and PWA

I am trying to make my app occupy the entire height of the browser using resize event.

Here is the sample code:

import React from 'react'
import { observer } from 'mobx-react'
import { observable } from 'mobx'

import { AppWrapper } from './styledComponents'

@observer
class App extends React.Component {
 @observable availableHeight: number = window.innerHeight

 componentDidMount() {
    window.addEventListener('resize', this.handleResize)
 }

 componentWillUnMount() {
    window.removeEventListener('resize', this.handleResize)
 }

 handleResize = () => {
    this.availableHeight = window.innerHeight
 }

 render() {
    return (
       <AppWrapper height={this.availableHeight}>
          ...
       </AppWrapper>
    )
 }
}

export default App
export const AppWrapper = styled.div`
${tw`min-h-full`}
   height: ${({ height }) => height}px;
`

It's working as expected on Android devices, but I started facing issues in the ios browsers.

When Keypad is open, I am getting some white space at the bottom of App and it persists even when the keypad is closed.

Same with the Bottom Address bar also, the resize event is not even triggered in such cases.

This issue is persisting in the PWA also.

Is there any way to avoid these height-related issues in ios?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda