Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Carousel #3201

Merged
merged 6 commits into from Jul 31, 2018
Merged

Update Carousel #3201

merged 6 commits into from Jul 31, 2018

Conversation

jquense
Copy link
Member

@jquense jquense commented Jul 21, 2018

this is such a meh component…

still doesn’t have keyboard events or support for the other animations…

@jquense
Copy link
Member Author

jquense commented Jul 30, 2018

this is done i think

@jquense jquense merged commit 5f0bb10 into v4-support Jul 31, 2018
@jquense jquense deleted the carousel branch July 31, 2018 16:48
src/Carousel.js Outdated
import * as ValidComponentChildren from './utils/ValidComponentChildren';
import { createBootstrapComponent } from './ThemeProvider';

// TODO: `slide` should be `animate`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

address this?

prevIcon: <Glyphicon glyph="chevron-left" />,
activeIndex: 0,

prevIcon: <span className="carousel-control-prev-icon" aria-hidden="true" />,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this derive from bsClass somehow?

www/src/html.js Outdated
@@ -1,46 +0,0 @@
import PropTypes from 'prop-types';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, not needed any more?

@@ -11,7 +11,6 @@ class ControlledCarousel extends React.Component {
}

handleSelect(selectedIndex, e) {
alert(`selected=${selectedIndex}, direction=${e.direction}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

@@ -0,0 +1,5 @@
// reading a dimension prop will cause the browser to recalculate,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this go in dom-helpers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes


setPostBodyComponents([
<script
key="asfasfasfas"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

}
let direction;
if (
(nextIndex === 0 && previousActiveIndex >= lastPossibleIndex) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when does this trigger? if previously there were 3 items, but now there's only 1? why should that trigger "next", v going from 3 -> 2 trigger "prev"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, when the slides wrap you want to continue in the same direction you we're going. this isn't a perfect check but I think this component is dumb and don't want to spend lots of time on it :P

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm so that's if previousActiveIndex == lastPossibleIndex... except what if the user clicks on the indicator? or if you're cycling back from 0 to final

const { slide, interval, activeIndex: activeIndexProp } = this.props;
select(index, event, direction) {
clearTimeout(this.selectThrottle);
if (event && event.persist) event.persist();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can probably kill this logic of decorating the event

};

handleMouseOut = () => {
this.cycle();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only if we're doing "pause on hover"? otherwise why should mousing out reset the timer?

const {
activeIndex,
previousActiveIndex,
prevClasses,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe prevClassName and currentClassName would be better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants