Skip to content

Commit

Permalink
added jsx-a11y to eslint. material-ui upgraded to 1.0.0.beta.26. now …
Browse files Browse the repository at this point in the history
…injecting MUIPopover with container
  • Loading branch information
gregnb committed Dec 31, 2017
1 parent 8dba3f7 commit 533a818
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 42 deletions.
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,21 @@
"mocha": true,
"node": true
},
"extends": [
"plugin:jsx-a11y/recommended"
],
"rules": {
"no-console": "off",
"semi": 2,
"no-tabs": 2,
"jsx-a11y/no-autofocus": [ 2, {
"ignoreNonDOM": true
}]
},
"plugins": [
"import",
"react",
"jsx-a11y",
"filenames"
]
}
115 changes: 83 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@
"cross-env": "^5.1.1",
"enzyme": "^3.2.0",
"enzyme-adapter-react-16": "^1.1.0",
"eslint": "^4.13.1",
"eslint": "^4.14.0",
"eslint-plugin-filenames": "^1.2.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.5.1",
"ignore-styles": "^5.0.1",
"jsdom": "^11.5.1",
Expand All @@ -77,7 +78,7 @@
"lodash.get": "^4.4.2",
"lodash.memoize": "^4.1.2",
"lodash.merge": "^4.6.0",
"material-ui": "^1.0.0-beta.22",
"material-ui": "^1.0.0-beta.26",
"material-ui-icons": "^1.0.0-beta.17",
"prop-types": "^15.6.0",
"react": "^16.0.0",
Expand Down
1 change: 0 additions & 1 deletion src/MUIDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import MUIDataTableFilterList from "./MUIDataTableFilterList";
import MUIDataTableBody from "./MUIDataTableBody";
import MUIDataTableHead from "./MUIDataTableHead";
import MUIDataTablePagination from "./MUIDataTablePagination";
import debounce from "lodash.debounce";
import { getStyle, DataStyles } from "./DataStyles";

const defaultTableStyles = {
Expand Down
4 changes: 2 additions & 2 deletions src/MUIDataTableFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class MUIDataTableFilter extends React.Component {
})}>
FILTERS
</Typography>
<a className={filterStyles.resetLink} tabIndex={0} aria-label="Reset Filters" onClick={onFilterReset}>
<button className={filterStyles.resetLink} tabIndex={0} aria-label="Reset Filters" onClick={onFilterReset}>
RESET
</a>
</button>
</div>
<div className={filterStyles.filtersSelected} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/MUIDataTableHeadCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class MUIDataTableHeadCell extends React.Component {
</span>
</Tooltip>
) : (
<span tabIndex={0}>{children}</span>
children
)}
</TableCell>
);
Expand Down
6 changes: 4 additions & 2 deletions src/MUIDataTableToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export const defaultFilterStyles = {
marginLeft: "24px",
fontSize: "12px",
cursor: "pointer",
border: "none",
"&:hover": {
color: "#FF0000",
},
Expand Down Expand Up @@ -282,6 +283,7 @@ class MUIDataTableToolbar extends React.Component {
searchTextUpdate,
toggleViewColumn,
title,
tableRef,
} = this.props;

const { showSearch } = this.state;
Expand Down Expand Up @@ -345,7 +347,7 @@ class MUIDataTableToolbar extends React.Component {
name="MUIDataTableViewCol"
styles={getStyle(options, "viewColumns")}>
{viewColStyles => (
<MUIPopover refExit={this.setActiveIcon.bind(null)}>
<MUIPopover refExit={this.setActiveIcon.bind(null)} container={tableRef}>
<MUIPopoverTarget>
<Tooltip title="View Columns">
<IconButton
Expand Down Expand Up @@ -377,7 +379,7 @@ class MUIDataTableToolbar extends React.Component {
name="MUIDataTableFilter"
styles={getStyle(options, "filterView")}>
{filterStyles => (
<MUIPopover refExit={this.setActiveIcon.bind(null)}>
<MUIPopover refExit={this.setActiveIcon.bind(null)} container={tableRef}>
<MUIPopoverTarget>
<Tooltip title="Filter Table">
<IconButton
Expand Down
7 changes: 5 additions & 2 deletions src/MUIPopover/MUIPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ class MUIPopover extends React.Component {
render() {
let popoverRender = [];

React.Children.map(this.props.children, (child, index) => {
const { className, placement, refClose, refExit, children, ...providedProps } = this.props;

React.Children.map(children, (child, index) => {
if (child.type === MUIPopoverContent) {
const transformOriginSpecs = {
vertical: "top",
Expand All @@ -90,7 +92,8 @@ class MUIPopover extends React.Component {
anchorEl={this.anchorEl}
ref={el => this.popoverEl}
anchorOrigin={anchorOriginSpecs}
transformOrigin={transformOriginSpecs}>
transformOrigin={transformOriginSpecs}
{...providedProps}>
{child}
</Popover>
);
Expand Down

0 comments on commit 533a818

Please sign in to comment.