The properties containerStyle, dense, titleStyle, scrollable settings of the Tab component are no effect
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
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
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de react-native-elements/react-native-elements
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
react-native-elements/react-native-elements#4035 · 1 comentario ·
-
Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
react-native-elements/react-native-elements#3963 · 2 comentarios · 2 reacciones ·
-
component: Button
react-native-elements/react-native-elements#4032 · 1 asignado ·
-
TS Bug - @rneui/base@5.0.0 — Undeclared type dependency causes IconProps to lose color/name/size Abiertocomponent: Icon
react-native-elements/react-native-elements#4027 · 2 comentarios · 4 reacciones · 1 asignado ·
-
📞 Needs Response from Author
react-native-elements/react-native-elements#4022 · 9 comentarios · 2 reacciones · 1 asignado ·
Todos los issues de react-native-elements/react-native-elements
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
hemilabs/ui-monorepo#2323 ·
-
Needs: Author Feedback Needs: Repro
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
react/react-native#58621 · 1 comentario ·
-
contributor: external needs review
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
ionic-team/capacitor#8616 ·
-
code quality good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100