Skip to content

Commit

Permalink
Merge remote-tracking branch 'call_em_all_-_master/master' (#43)
Browse files Browse the repository at this point in the history
* call_em_all_-_master/master:
  [docs] Promote the v1.0.0-alpha (mui#7273)
  Issue 7175 (mui#7260)
  Fix regressions (mui#7262)
  [tests] correct values expected by autoprefixer (mui#7267)

# Conflicts:
#	src/internal/FocusRipple.js

* fixed step to have a default array of no children, as without it the tests were failing
  • Loading branch information
djbuckley committed Jun 28, 2017
2 parents eb04084 + 82ac3fd commit 0248a6c
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Expand Up @@ -6,7 +6,7 @@
### Link to minimal working code that reproduces the issue

<!-- You may provide a repository or use our template-ready webpackbin
master: https://www.webpackbin.com/bins/-Kh7G86UTg0ckGC2hL94
master: https://www.webpackbin.com/bins/-KndEyl53H8td-WNXaut
next: https://www.webpackbin.com/bins/-Kh8lDulAxDq8j-7yTew
-->
Expand Down
5 changes: 5 additions & 0 deletions docs/src/app/components/AppNavDrawer.js
Expand Up @@ -12,6 +12,10 @@ import {cyan500} from 'material-ui/styles/colors';
const SelectableList = makeSelectable(List);

const styles = {
v1: {
height: 40,
backgroundColor: '#2196f3',
},
logo: {
cursor: 'pointer',
fontSize: 24,
Expand Down Expand Up @@ -121,6 +125,7 @@ class AppNavDrawer extends Component {
onRequestChange={onRequestChangeNavDrawer}
containerStyle={{zIndex: zIndex.drawer - 100}}
>
<div style={styles.v1} />
<div style={styles.logo} onTouchTap={this.handleTouchTapHeader}>
Material-UI
</div>
Expand Down
25 changes: 20 additions & 5 deletions docs/src/app/components/Master.js
Expand Up @@ -50,11 +50,19 @@ class Master extends Component {

getStyles() {
const styles = {
v1: {
height: 40,
backgroundColor: '#2196f3',
display: 'flex',
color: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
appBar: {
position: 'fixed',
// Needed to overlap the examples
zIndex: this.state.muiTheme.zIndex.appBar + 1,
top: 0,
top: 40,
},
root: {
paddingTop: spacing.desktopKeylineIncrement,
Expand Down Expand Up @@ -117,10 +125,12 @@ class Master extends Component {
};

handleChangeList = (event, value) => {
this.context.router.push(value);
this.setState({
navDrawerOpen: false,
});
if (value) {
this.context.router.push(value);
this.setState({
navDrawerOpen: false,
});
}
};

handleChangeMuiTheme = (muiTheme) => {
Expand Down Expand Up @@ -169,6 +179,11 @@ class Master extends Component {
return (
<div>
<Title render="Material-UI" />
<a style={prepareStyles(styles.v1)} href="https://material-ui-1dab0.firebaseapp.com/">
<span>
Aww yeah, Material-UI v1 is coming!
</span>
</a>
<AppBar
onLeftIconButtonTouchTap={this.handleTouchTapLeftIconButton}
title={title}
Expand Down
1 change: 0 additions & 1 deletion src/RaisedButton/RaisedButton.js
Expand Up @@ -73,7 +73,6 @@ function getStyles(props, context, state) {
borderRadius,
transition: transitions.easeOut(),
backgroundColor: backgroundColor,
overflow: 'hidden',
// That's the default value for a button but not a link
textAlign: 'center',
},
Expand Down
5 changes: 4 additions & 1 deletion src/Stepper/Step.js
Expand Up @@ -62,6 +62,10 @@ class Step extends Component {
style: PropTypes.object,
};

static defaultProps = {
children: [],
}

static contextTypes = {
muiTheme: PropTypes.object.isRequired,
stepper: PropTypes.object,
Expand All @@ -72,7 +76,6 @@ class Step extends Component {
this.uniqueId = uniqueId.replace(/[^A-Za-z0-9-]/gi, '');
}


renderChild = (child) => {
const {
active,
Expand Down
4 changes: 2 additions & 2 deletions src/TextField/EnhancedTextarea.js
Expand Up @@ -76,7 +76,7 @@ class EnhancedTextarea extends Component {
}

componentDidMount() {
this.syncHeightWithShadow();
this.syncHeightWithShadow(this.props.value);
}

componentWillReceiveProps(nextProps) {
Expand All @@ -87,7 +87,7 @@ class EnhancedTextarea extends Component {
}

handleResize = (event) => {
this.syncHeightWithShadow(undefined, event);
this.syncHeightWithShadow(this.props.value, event);
};

getInputNode() {
Expand Down
43 changes: 43 additions & 0 deletions src/TextField/EnhancedTextarea.spec.js
@@ -0,0 +1,43 @@
/* eslint-env mocha */
import React from 'react';
import PropTypes from 'prop-types';
import {mount} from 'enzyme';
import {assert} from 'chai';
import EnhancedTextarea from './EnhancedTextarea';
import getMuiTheme from '../styles/getMuiTheme';

describe('<EnhancedTextArea />', () => {
const muiTheme = getMuiTheme();
const rowHeight = 24;
const mountWithContext = (node) => mount(node, {
context: {muiTheme},
childContextTypes: {muiTheme: PropTypes.object},
});

it('renders with no arguments', () => {
const wrapper = mountWithContext(
<EnhancedTextarea />
);
assert.isAbove(wrapper.find('div').length, 0);
});

it('has one row initial height', () => {
const wrapper = mountWithContext(
<EnhancedTextarea />
);
assert.strictEqual(wrapper.state().height, rowHeight);
});

// This test will not succeed due to
// jsdom limitations
// https://github.com/tmpvar/jsdom/issues/1013
/* eslint mocha/no-skipped-tests: 0 */
it.skip('has zero initial height', () => {
const wrapper = mountWithContext(
<EnhancedTextarea
value="A really long string that should go over multiple lines and should trigger more rows than one"
/>
);
assert.isAbove(wrapper.state().height, rowHeight);
});
});
3 changes: 3 additions & 0 deletions src/internal/EnhancedButton.js
Expand Up @@ -171,6 +171,9 @@ class EnhancedButton extends Component {
color={focusRippleColor}
opacity={focusRippleOpacity}
show={isKeyboardFocused}
style={{
overflow: 'hidden',
}}
key="focusRipple"
/>
) : undefined;
Expand Down
6 changes: 3 additions & 3 deletions src/internal/FocusRipple.js
Expand Up @@ -4,7 +4,7 @@ import ReactDOM from 'react-dom';
import shallowEqual from 'recompose/shallowEqual';
import autoPrefix from '../utils/autoPrefix';
import transitions from '../styles/transitions';
import ScaleInTransitionGroup from './ScaleIn';
import ScaleIn from './ScaleIn';

const pulsateDuration = 750;

Expand Down Expand Up @@ -125,13 +125,13 @@ class FocusRipple extends Component {
const ripple = show ? this.getRippleElement(this.props, baseId) : null;

return (
<ScaleInTransitionGroup
<ScaleIn
id={baseId}
maxScale={0.85}
style={mergedRootStyles}
>
{ripple}
</ScaleInTransitionGroup>
</ScaleIn>
);
}
}
Expand Down

0 comments on commit 0248a6c

Please sign in to comment.