Skip to content

Commit

Permalink
Merge pull request #5444 from oliviertassinari/popover-fix-anchorEl-i…
Browse files Browse the repository at this point in the history
…nvalid

[Popover] Fix support for invalid anchorEl
  • Loading branch information
oliviertassinari authored Oct 21, 2016
2 parents 3701738 + 09b01ba commit 4eba84e
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/AppBar/AppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ class AppBar extends Component {
};

componentDidMount() {
warning(!this.props.iconElementLeft || !this.props.iconClassNameLeft, `Properties iconElementLeft
warning(!this.props.iconElementLeft || !this.props.iconClassNameLeft, `Material-UI: Properties iconElementLeft
and iconClassNameLeft cannot be simultaneously defined. Please use one or the other.`);

warning(!this.props.iconElementRight || !this.props.iconClassNameRight, `Properties iconElementRight
warning(!this.props.iconElementRight || !this.props.iconClassNameRight, `Material-UI: Properties iconElementRight
and iconClassNameRight cannot be simultaneously defined. Please use one or the other.`);
}

Expand Down
4 changes: 2 additions & 2 deletions src/DatePicker/dateUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const monthLongList = ['January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'];

export function dateTimeFormat(locale, options) {
warning(locale === 'en-US', `The ${locale} locale is not supported by the built-in DateTimeFormat.
warning(locale === 'en-US', `Material-UI: The ${locale} locale is not supported by the built-in DateTimeFormat.
Use the \`DateTimeFormat\` prop to supply an alternative implementation.`);

this.format = function(date) {
Expand All @@ -25,7 +25,7 @@ export function dateTimeFormat(locale, options) {
} else if (options.day === 'numeric') {
return date.getDate();
} else {
warning(false, 'Wrong usage of DateTimeFormat');
warning(false, 'Material-UI: Wrong usage of DateTimeFormat');
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/FloatingActionButton/FloatingActionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class FloatingActionButton extends Component {

componentDidMount() {
warning(!this.props.iconClassName || !this.props.children,
'You have set both an iconClassName and a child icon. ' +
'Material-UI: You have set both an iconClassName and a child icon. ' +
'It is recommended you use only one method when adding ' +
'icons to FloatingActionButtons.');
}
Expand Down
8 changes: 1 addition & 7 deletions src/Popover/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ import Paper from '../Paper';
import throttle from 'lodash.throttle';
import PopoverAnimationDefault from './PopoverAnimationDefault';

const styles = {
root: {
display: 'none',
},
};

class Popover extends Component {
static propTypes = {
/**
Expand Down Expand Up @@ -383,7 +377,7 @@ class Popover extends Component {

render() {
return (
<div style={styles.root}>
<div>
<EventListener
target="window"
onScroll={this.handleScroll}
Expand Down
2 changes: 1 addition & 1 deletion src/RadioButton/RadioButtonGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class RadioButtonGroup extends Component {
if (this.state.numberCheckedRadioButtons === 0) {
this.setState({selected: newSelection});
} else {
warning(false, `Cannot select a different radio button while another radio button
warning(false, `Material-UI: Cannot select a different radio button while another radio button
has the 'checked' property set to true.`);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Stepper/StepContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class StepContent extends Component {
const {stepper, muiTheme: {prepareStyles}} = this.context;

if (stepper.orientation !== 'vertical') {
warning(false, '<StepContent /> is only designed for use with the vertical stepper.');
warning(false, 'Material-UI: <StepContent /> is only designed for use with the vertical stepper.');
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ class Tabs extends Component {

const tabs = this.getTabs().map((tab, index) => {
warning(tab.type && tab.type.muiName === 'Tab',
`Tabs only accepts Tab Components as children.
`Material-UI: Tabs only accepts Tab Components as children.
Found ${tab.type.muiName || tab.type} as child number ${index + 1} of Tabs`);

warning(!tabValue || tab.props.value !== undefined,
`Tabs value prop has been passed, but Tab ${index}
`Material-UI: Tabs value prop has been passed, but Tab ${index}
does not have a value prop. Needs value if Tabs is going
to be a controlled component.`);

Expand Down
2 changes: 1 addition & 1 deletion src/TextField/TextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class TextField extends Component {
hasValue: isValid(propsLeaf.value) || isValid(propsLeaf.defaultValue),
});

warning(name || hintText || floatingLabelText || id, `We don't have enough information
warning(name || hintText || floatingLabelText || id, `Material-UI: We don't have enough information
to build a robust unique id for the TextField component. Please provide an id or a name.`);

const uniqueId = `${name}-${hintText}-${floatingLabelText}-${
Expand Down
2 changes: 1 addition & 1 deletion src/internal/EnhancedSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class EnhancedSwitch extends Component {
}
this.refs.checkbox.checked = newSwitchedValue;
} else {
warning(false, 'Cannot call set method while checked is defined as a property.');
warning(false, 'Material-UI: Cannot call set method while checked is defined as a property.');
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/callOnce.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function callOnce() {
if (process.env.NODE_ENV !== 'production') {
return (style) => {
if (style[CALLED_ONCE]) {
warning(false, 'You cannot call prepareStyles() on the same style object more than once.');
warning(false, 'Material-UI: You cannot call prepareStyles() on the same style object more than once.');
}
style[CALLED_ONCE] = true;
return style;
Expand Down

0 comments on commit 4eba84e

Please sign in to comment.