mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-27 19:42:11 +10:00
Merge pull request #675 from sharetribe/smoothscroll-new-wzrd
Create listing flow: smooth scrolling polyfill to scroll to correct tab
This commit is contained in:
commit
ed7aac088e
2 changed files with 11 additions and 0 deletions
|
|
@ -101,6 +101,11 @@ class EditListingWizard extends Component {
|
|||
|
||||
// Having this info in state would trigger unnecessary rerendering
|
||||
this.hasScrolledToTab = false;
|
||||
this.handleCreateFlowTabScrolling = this.handleCreateFlowTabScrolling.bind(this);
|
||||
}
|
||||
|
||||
handleCreateFlowTabScrolling(shouldScroll) {
|
||||
this.hasScrolledToTab = shouldScroll;
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
@ -155,6 +160,7 @@ class EditListingWizard extends Component {
|
|||
params={params}
|
||||
listing={listing}
|
||||
marketplaceTabs={TABS}
|
||||
handleCreateFlowTabScrolling={this.handleCreateFlowTabScrolling}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ const EditListingWizardTab = props => {
|
|||
history,
|
||||
images,
|
||||
listing,
|
||||
handleCreateFlowTabScrolling,
|
||||
onCreateListing,
|
||||
onUpdateListing,
|
||||
onCreateListingDraft,
|
||||
|
|
@ -68,6 +69,9 @@ const EditListingWizardTab = props => {
|
|||
if (isNew) {
|
||||
const onUpsertListingDraft = currentListing.id ? onUpdateListingDraft : onCreateListingDraft;
|
||||
onUpsertListingDraft(updateValues);
|
||||
|
||||
// Create listing flow: smooth scrolling polyfill to scroll to correct tab
|
||||
handleCreateFlowTabScrolling(false);
|
||||
// Redirect to next tab
|
||||
const pathParams = pathParamsToNextTab(params, tab, marketplaceTabs);
|
||||
history.push(
|
||||
|
|
@ -225,6 +229,7 @@ EditListingWizardTab.propTypes = {
|
|||
images: array,
|
||||
}),
|
||||
|
||||
handleCreateFlowTabScrolling: func.isRequired,
|
||||
onCreateListing: func.isRequired,
|
||||
onUpdateListing: func.isRequired,
|
||||
onCreateListingDraft: func.isRequired,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue