Fix bug in WizardPanel property passing

This commit is contained in:
Eric Schultz 2018-06-27 16:19:55 -05:00
parent 68dcbaf515
commit 607b654091
3 changed files with 6 additions and 4 deletions

View file

@ -28,7 +28,7 @@ describe('WizardPanel', () => {
ws.addTab('something', 'something label',{} )
ws.initialize()
const tree = shallow(<Component.WizardPanel tab={ws.tabsByName['something']}><hr/></Component.WizardPanel>)
const tree = shallow(<Component.WizardPanel tab={ws.tabsByName['something']} anotherProp={false}><hr/></Component.WizardPanel>)
expect(toJson(tree)).toMatchSnapshot()

View file

@ -4,6 +4,7 @@ import { TabPanel } from "react-aria-tabpanel";
import { observer } from 'mobx-react'
import { WizardTabPanelState} from './wizard_state';
import {computed} from 'mobx';
import * as _ from 'lodash'
export interface WizardTabPanelProps {
@ -26,9 +27,9 @@ export class WizardPanel extends React.Component<WizardPanelProps, {}> {
}
render() {
let props = this.props.props ? this.props.props : {}
return <TabPanel tabId={this.tab.id} active={this.isActive}
{...props} className="wizard-step">
let props = _.omit(this.props, ['tab'])
return <TabPanel {...props} tabId={this.tab.id} active={this.isActive}
className="wizard-step">
{this.props.children}
</TabPanel>
}

View file

@ -3,6 +3,7 @@
exports[`WizardPanel shallow render 1`] = `
<AriaTabPanel-TabPanel
active={true}
anotherProp={false}
className="wizard-step"
tabId="tab1"
tag="div"