[fix] ProgressBar indicator overflow

This allows ProgressBar to correctly render provided styles like
'border-radius' without the indicator bar overflowing.
This commit is contained in:
Nicolas Gallagher
2017-06-17 08:48:37 -07:00
parent 5a5eb5425f
commit 635fda8d63
3 changed files with 9 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ import React, { Component } from 'react';
import { bool, number } from 'prop-types';
class ProgressBar extends Component {
_progressElement = null;
_progressElement: View;
static displayName = 'ProgressBar';
@@ -80,10 +80,12 @@ const styles = StyleSheet.create({
track: {
height: 5,
overflow: 'hidden',
userSelect: 'none'
userSelect: 'none',
zIndex: 0
},
progress: {
height: '100%'
height: '100%',
zIndex: -1
},
animation: {
animationDuration: '1s',

View File

@@ -19,7 +19,7 @@ const thumbFocusedBoxShadow = `${thumbDefaultBoxShadow}, 0 0 0 10px rgba(0,0,0,0
class Switch extends PureComponent {
_checkboxElement: HTMLInputElement;
_thumbElement = null;
_thumbElement: View;
static displayName = 'Switch';

View File

@@ -70,7 +70,9 @@ class View extends Component {
otherProps.style.unshift(styles.hasHitSlop);
}
// avoid HTML validation errors
const component = isInAButtonView ? 'span' : 'div';
return createDOMElement(component, otherProps);
}
}
@@ -95,7 +97,7 @@ const styles = StyleSheet.create({
inline: {
display: 'inline-flex'
},
// this zIndex ordering positions the hitSlop above the View but behind
// this zIndex-ordering positions the hitSlop above the View but behind
// its children
hasHitSlop: {
zIndex: 0