diff --git a/scss/components/_carousel.scss b/scss/components/_carousel.scss index 39bd2d20c..406f5fd02 100644 --- a/scss/components/_carousel.scss +++ b/scss/components/_carousel.scss @@ -17,6 +17,8 @@ } .#{$ns}Carousel { + min-width: $Carousel-minWidth; + height: $Carousel-height; position: relative; display: block; background: $Carousel-bg; @@ -56,8 +58,8 @@ } &-container { - min-width: $Carousel-minWidth; - height: $Carousel-height; + width: 100%; + height: 100%; position: relative; overflow: hidden; diff --git a/src/renderers/Audio.tsx b/src/renderers/Audio.tsx index 3bb90f2c4..6617773ef 100644 --- a/src/renderers/Audio.tsx +++ b/src/renderers/Audio.tsx @@ -4,6 +4,7 @@ import {Renderer, RendererProps} from '../factory'; import {autobind} from '../utils/helper'; import {volumeIcon, muteIcon, playIcon, pauseIcon} from '../components/icons'; import {resolveVariable} from '../utils/tpl-builtin'; +import {filter} from '../utils/tpl'; export interface AudioProps extends RendererProps { className?: string; @@ -49,7 +50,7 @@ export class Audio extends React.Component { }; state: AudioState = { - src: this.props.value || this.props.src || resolveVariable(this.props.name, this.props.data) || '', + src: this.props.value || (this.props.src ? filter(this.props.src, this.props.data) : '') || resolveVariable(this.props.name, this.props.data) || '', isReady: false, muted: false, playing: false, @@ -82,9 +83,12 @@ export class Audio extends React.Component { componentWillReceiveProps(nextProps:AudioProps) { const props = this.props; - if (props.value !== nextProps.value || props.src !== nextProps.src) { + if ( + props.value !== nextProps.value || + filter(props.src as string, props.data) !== filter(nextProps.src as string, nextProps.data) + ) { this.setState({ - src: nextProps.value || nextProps.src, + src: nextProps.value || filter(nextProps.src as string, nextProps.data), playing: false }, () => { this.audio.load(); diff --git a/src/renderers/Carousel.tsx b/src/renderers/Carousel.tsx index 4e5fb8820..316d0850a 100644 --- a/src/renderers/Carousel.tsx +++ b/src/renderers/Carousel.tsx @@ -262,7 +262,6 @@ export class Carousel extends React.Component { className={cx('Carousel-container')} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave} - style={carouselStyles} > {options.map((option:any, key:number) => ( { } return ( -
+
{body ? body : placeholder}
);