The properties containerStyle, dense, titleStyle, scrollable settings of the Tab component are no effect

Abierto
#3,941 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
react-native
Área
mobile

Línea de trabajo

Start at the Tab component entry point and reproduce the supplied examples with containerStyle, dense, titleStyle, and scrollable. Trace how each prop reaches the rendered view, then verify that the reported styling, density, and scrolling behavior changes as expected.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Needs Triage
Is there an existing issue for this?
  • I have searched the existing issues
Explain what you did

I am verifying all the properties of the tab, but some properties are not effective

Expected behavior

I set CSS styles for these properties, but it didn't work

Describe the bug

The set values have no effect on the view. Here is my code

Steps To Reproduce
I set CSS styles for containerStyle but it didn't work

 <Tab
              value={Math.ceil(index1 > -1 ? index1 : 0)}
              onChange={e => setIndex1(e)}
              indicatorStyle={{
                backgroundColor: 'white',
                height: 3,
              }}
              scrollable
              variant="primary"
              containerStyle={active => ({
                backgroundColor: 'yellow',
                borderRadius: 20,
                width:100,
                borderWidth:2,
                borderColor:'black'
              })}
              dense={true}>
              <Tab.Item
                containerStyle={active => ({
                  width: 113,
                  backgroundColor: active ? '#208990' : 'transparent',
                })}
                title="Recent"
                titleStyle={{fontSize: 12}}
                icon={{name: 'calendar', type: 'font-awesome', color: 'white'}}
              />
              <Tab.Item
                title="Custom"
                containerStyle={active => ({
                  backgroundColor: active ? '#208990' : 'transparent',
                  width: 115,
                })}
                titleStyle={{fontSize: 12}}
                icon={{name: 'heart', type: 'font-awesome', color: 'white'}}
              />
              <Tab.Item
                containerStyle={active => ({
                  width: 118,
                  backgroundColor: active ? '#208990' : 'transparent',
                })}
                title="Cart"
                titleStyle={{fontSize: 12}}
                icon={{
                  name: 'shopping-cart',
                  type: 'font-awesome',
                  color: 'white',
                }}
              />
            </Tab>
Setting the values of true and false for dense has no effect
   <Tab
              value={Math.ceil(index2 > -1 ? index2 : 0)}
              onChange={e => setIndex2(e)}
              indicatorStyle={{
                backgroundColor: 'white',
                height: 3,
              }}
              dense={true}
              scrollable
              variant="primary"
              containerStyle={{backgroundColor: 'yellow', borderRadius: 20}}>
              <Tab.Item
                containerStyle={active => ({
                  width: 113,
                  backgroundColor: active ? '#208990' : 'transparent',
                })}
                dense={true}
                title="Recent"
                titleStyle={{fontSize: 12}}
                icon={{name: 'calendar', type: 'font-awesome', color: 'white'}}
              />
              <Tab.Item
                title="Custom"
                containerStyle={active => ({
                  backgroundColor: active ? '#208990' : 'transparent',
                  width: 115,
                })}
                titleStyle={{fontSize: 12}}
                icon={{name: 'heart', type: 'font-awesome', color: 'white'}}
              />
              <Tab.Item
                containerStyle={active => ({
                  width: 118,
                  backgroundColor: active ? '#208990' : 'transparent',
                })}
                title="Cart"
                titleStyle={{fontSize: 12}}
                icon={{
                  name: 'shopping-cart',
                  type: 'font-awesome',
                  color: 'white',
                }}
              />
            </Tab>
Setting scrollable to false has no effect. Tab can still scroll
     <Tab
              value={Math.ceil(index8 > -1 ? index8 : 0)}
              onChange={e => setIndex8(e)}
              indicatorStyle={{
                backgroundColor: 'pink',
                height: 5,
                borderRadius: 2.5,
              }}
              scrollable={false}
              // variant="default"
              style={{
                backgroundColor:
                  index8 == 0 ? 'yellow' : index8 == 1 ? 'red' : 'blue',
              }}
              // dense={false}
              >
              <Tab.Item
                containerStyle={active => ({
                  width: 113,
                  backgroundColor: active ? '#208990' : 'transparent',
                })}
                title="Recent"
                titleStyle={{fontSize: 12}}
                icon={{name: 'calendar', type: 'font-awesome', color: 'black'}}
              />
              <Tab.Item
                title="Custom"
                containerStyle={active => ({
                  backgroundColor: active ? '#208990' : 'transparent',
                  width: 115,
                })}
                titleStyle={{fontSize: 12}}
                icon={{name: 'heart', type: 'font-awesome', color: 'black'}}
              />
              <Tab.Item
                containerStyle={active => ({
                  width: 118,
                  backgroundColor: active ? '#208990' : 'transparent',
                })}
                title="Cart"
                titleStyle={{fontSize: 12}}
                icon={{
                  name: 'shopping-cart',
                  type: 'font-awesome',
                  color: 'black',
                }}
              />
            </Tab>
Title Style setting font CSS has no effect on the view
      <Tab
              titleStyle={active => ({
                fontSize: 100,
                fontWeight: '400',
                color: '#222222',
              })}
              value={Math.ceil(index9 > -1 ? index9 : 0)}
              onChange={e => setIndex9(e)}
              indicatorStyle={{
                backgroundColor: 'pink',
                height: 5,
                borderRadius: 2.5,
              }}
              scrollable
              variant="default"
              style={{
                backgroundColor:
                  index9 == 0 ? 'yellow' : index9 == 1 ? 'red' : 'blue',
              }}
              dense={false}>
              <Tab.Item
                containerStyle={active => ({
                  width: 113,
                  backgroundColor: active ? '#208990' : 'transparent',
                })}
                title="Recent"
                titleStyle={{fontSize: 12}}
                icon={{name: 'calendar', type: 'font-awesome', color: 'black'}}
              />
              <Tab.Item
                title="Custom"
                containerStyle={active => ({
                  backgroundColor: active ? '#208990' : 'transparent',
                  width: 115,
                })}
                titleStyle={{fontSize: 12}}
                icon={{name: 'heart', type: 'font-awesome', color: 'black'}}
              />
              <Tab.Item
                containerStyle={active => ({
                  width: 118,
                  backgroundColor: active ? '#208990' : 'transparent',
                })}
                title="Cart"
                titleStyle={{fontSize: 12}}
                icon={{
                  name: 'shopping-cart',
                  type: 'font-awesome',
                  color: 'black',
                }}
              />
            </Tab>
Screenshots

No response

Your Environment
`npx @rneui/envinfo`
  ```
 "@rneui/base": "^4.0.0-rc.7",
"@rneui/themed": "^4.0.0-rc.8",
  ```
Lenguaje dominante
MDX
Estrellas
25.9k
Forks
4.7k
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de react-native-elements/react-native-elements

Todos los issues de react-native-elements/react-native-elements

Issues similares

Más issues de Mobile Dev

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.