react / react/react-native

Components inside the Text wont follow the width of the Text when screen Orientation is changed

Aperta
#31,171 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Component: Text Issue: Author Provided Repro
Lingua principale
C++
Stelle
127k
Fork
25.3k
Merge medio
1g 23h
PR unite (30g)
4

Descrizione

Description

So I implement AdMobBanner and then decided to place is inside the Text component.
Why I did that, Well I have AdMobBanner inside TouchableOpacity component and if I do not place it inside the Text, the user wont be able to click on it.

Now this is not the problem, the problem is that when the screen Orientation is changed the component inside the Text wont follow for some reason.

React Native version:

System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz
    Memory: 1.13 GB / 7.92 GB
  Binaries:
    Node: 15.6.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.14.11 - D:\Projects\NovelManager\node_modules\.bin\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 26, 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.3
      System Images: android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Visual Studio: 16.7.30517.126 (Visual Studio Enterprise 2019)
  Languages:
    Java: 11.0.10 - C:\Program Files\AdoptOpenJDK\jdk-11.0.10.9-hotspot\bin\javac.EXE
    Python: 3.9.1 - C:\Python39\python.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: ~16.13.1 => 16.13.1
    react-native: ^0.63.4 => 0.63.4
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

I have create a demo that represent the problem here on snack
To test this you will have to view it on your phone.

This is the code you should look into when you navigate snack

               <Text key={attr["index"]} style={{maxWidth:"100%",minWidth:"100%", backgroundColor:"red", justifyContent:"center"}} onPress={e=> {e.preventDefault() }}>
                      <Banner bannerSize="smartBannerPortrait"
                      />
                    </Text>

Expected Results

The Text component should behave like View and when the screen Orientation is changed its children should also follow the Text component style

Snack, code example, screenshot, or link to a repository:

https://snack.expo.io/@alentoma/banner

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Apri lo Snack collegato e riproduci il problema su un telefono cambiando l’orientamento. Inizia con il componente Text che contiene il Banner e confronta la sua larghezza con il comportamento previsto; il lavoro è completato quando il Banner incorporato segue la larghezza di Text dopo i cambiamenti di orientamento.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
react-native
Ambito
mobile
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.