Skip to content

Commit

Permalink
Enable mouse events on all demos (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
akoepcke authored Feb 13, 2021
1 parent 904d738 commit d2a360b
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/src/pages/demos/DemoAnimateHeight.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Slide4.contextTypes = {

function DemoAnimateHeight() {
return (
<SwipeableViews animateHeight>
<SwipeableViews animateHeight enableMouseEvents>
<div style={Object.assign({}, styles.slide, styles.slide1)}>{list.slice(0, 10)}</div>
<div style={Object.assign({}, styles.slide, styles.slide2)}>
{'This slide has a max-height limit:'}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/DemoAutoPlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DemoAutoPlay extends React.Component {

return (
<div style={styles.root}>
<AutoPlaySwipeableViews index={index} onChangeIndex={this.handleChangeIndex}>
<AutoPlaySwipeableViews index={index} onChangeIndex={this.handleChangeIndex} enableMouseEvents>
<div style={Object.assign({}, styles.slide, styles.slide1)}>slide n°1</div>
<div style={Object.assign({}, styles.slide, styles.slide2)}>slide n°2</div>
<div style={Object.assign({}, styles.slide, styles.slide3)}>slide n°3</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/DemoAxis.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const styles = {

function DemoAxis() {
return (
<SwipeableViews containerStyle={styles.slideContainer} axis="y" resistance>
<SwipeableViews containerStyle={styles.slideContainer} axis="y" resistance enableMouseEvents>
<div style={Object.assign({}, styles.slide, styles.slide1)}>slide n°1</div>
<div style={Object.assign({}, styles.slide, styles.slide2)}>slide n°2</div>
<div style={styles.scroll}>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/DemoCircular.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function slideRenderer(params) {
}

function DemoSimple() {
return <VirtualizeSwipeableViews slideRenderer={slideRenderer} />;
return <VirtualizeSwipeableViews slideRenderer={slideRenderer} enableMouseEvents/>;
}

export default DemoSimple;
1 change: 1 addition & 0 deletions docs/src/pages/demos/DemoCoverflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class DemoCoverflow extends React.Component {
style={styles.root}
onChangeIndex={this.handleChangeIndex}
onSwitching={this.handleSwitch}
enableMouseEvents
>
{albums.map((album, currentIndex) => {
const inputRange = albums.map((_, i) => i);
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/DemoHocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function slideRenderer(params) {
}

function DemoHocs() {
return <EnhancedSwipeableViews slideCount={10} slideRenderer={slideRenderer} />;
return <EnhancedSwipeableViews slideCount={10} slideRenderer={slideRenderer} enableMouseEvents/>;
}

export default DemoHocs;
2 changes: 1 addition & 1 deletion docs/src/pages/demos/DemoKeyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const styles = {

function DemoKeyboard() {
return (
<BindKeyboardSwipeableViews>
<BindKeyboardSwipeableViews enableMouseEvents>
<div style={Object.assign({}, styles.slide, styles.slide1)}>slide n°1</div>
<div style={Object.assign({}, styles.slide, styles.slide2)}>slide n°2</div>
<div style={Object.assign({}, styles.slide, styles.slide3)}>slide n°3</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/demos/DemoNested.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ function DemoNested() {
</div>
slide n°2
<div style={styles.divider} />
<SwipeableViews>
<SwipeableViews enableMouseEvents>
<div style={Object.assign({}, styles.slide, styles.slide1)}>nested slide n°2.1</div>
<div style={Object.assign({}, styles.slide, styles.slide3)}>nested slide n°2.2</div>
</SwipeableViews>
</div>
<div style={Object.assign({}, styles.slide, styles.slide3)}>
slide n°3
<div style={styles.divider} />
<SwipeableViews axis="y" containerStyle={styles.slideContainerY}>
<SwipeableViews axis="y" containerStyle={styles.slideContainerY} enableMouseEvents>
<div style={Object.assign({}, styles.slide, styles.slide1)}>nested slide n°3.1</div>
<div style={Object.assign({}, styles.slide, styles.slide2)}>nested slide n°3.2</div>
</SwipeableViews>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/DemoResistance.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const styles = {

function DemoResistance() {
return (
<SwipeableViews resistance>
<SwipeableViews resistance enableMouseEvents>
<div style={Object.assign({}, styles.slide, styles.slide1)}>slide n°1</div>
<div style={Object.assign({}, styles.slide, styles.slide2)}>slide n°2</div>
<div style={Object.assign({}, styles.slide, styles.slide3)}>slide n°3</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/DemoRtl.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const styles = {
function DemoRtl() {
return (
<div style={styles.root}>
<SwipeableViews axis="x-reverse">
<SwipeableViews axis="x-reverse" enableMouseEvents>
<div style={Object.assign({}, styles.slide, styles.slide1)}>slide n°1</div>
<div style={Object.assign({}, styles.slide, styles.slide2)}>slide n°2</div>
<div style={Object.assign({}, styles.slide, styles.slide3)}>slide n°3</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/DemoScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ for (let i = 0; i < 30; i += 1) {

function DemoScroll() {
return (
<SwipeableViews containerStyle={styles.slideContainer}>
<SwipeableViews containerStyle={styles.slideContainer} enableMouseEvents>
<div style={Object.assign({}, styles.slide, styles.slide1)}>{list}</div>
<div style={Object.assign({}, styles.slide, styles.slide2)}>slide n°2</div>
<div style={Object.assign({}, styles.slide, styles.slide3)}>slide n°3</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/DemoTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DemoTabs extends React.Component {
<Tab label="tab n°2" />
<Tab label="tab n°3" />
</Tabs>
<SwipeableViews index={index} onChangeIndex={this.handleChangeIndex}>
<SwipeableViews index={index} onChangeIndex={this.handleChangeIndex} enableMouseEvents>
<div style={Object.assign({}, styles.slide, styles.slide1)}>slide n°1</div>
<div style={Object.assign({}, styles.slide, styles.slide2)}>
slide n°2
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/demos/DemoVirtualize.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class DemoVirtualize extends React.Component {
index={this.state.index}
onChangeIndex={this.handleChangeIndex}
slideRenderer={slideRenderer}
enableMouseEvents
/>
<br />
<Button onClick={this.handleClick}>{'go to slide n°50'}</Button>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/DemoWidth.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const styles = {

function DemoWidth() {
return (
<SwipeableViews style={styles.root} slideStyle={styles.slideContainer}>
<SwipeableViews style={styles.root} slideStyle={styles.slideContainer} enableMouseEvents>
<div style={Object.assign({}, styles.slide, styles.slide1)}>slide n°1</div>
<div style={Object.assign({}, styles.slide, styles.slide2)}>slide n°2</div>
<div style={Object.assign({}, styles.slide, styles.slide3)}>slide n°3</div>
Expand Down

0 comments on commit d2a360b

Please sign in to comment.