@@ -9,6 +9,7 @@ const sizePerPageDefaultClass = 'react-bs-table-sizePerPage-dropdown';
99const SizePerPageDropDown = ( props ) => {
1010 const {
1111 open,
12+ tableId,
1213 hidden,
1314 onClick,
1415 onBlur,
@@ -30,6 +31,8 @@ const SizePerPageDropDown = (props) => {
3031 className ,
3132 ) ;
3233
34+ const id = tableId ? `${ tableId } -pageDropDown` : 'pageDropDown' ;
35+
3336 return (
3437 < BootstrapContext . Consumer >
3538 {
@@ -39,7 +42,8 @@ const SizePerPageDropDown = (props) => {
3942 className = { dropdownClasses }
4043 >
4144 < button
42- id = "pageDropDown"
45+ id = { id }
46+ type = "button"
4347 className = { `btn ${ btnContextual } dropdown-toggle` }
4448 data-toggle = "dropdown"
4549 aria-expanded = { open }
@@ -59,7 +63,7 @@ const SizePerPageDropDown = (props) => {
5963 < ul
6064 className = { `dropdown-menu ${ openClass } ` }
6165 role = "menu"
62- aria-labelledby = "pageDropDown"
66+ aria-labelledby = { id }
6367 >
6468 {
6569 options . map ( ( option ) => {
@@ -93,6 +97,7 @@ SizePerPageDropDown.propTypes = {
9397 onClick : PropTypes . func . isRequired ,
9498 onBlur : PropTypes . func . isRequired ,
9599 onSizePerPageChange : PropTypes . func . isRequired ,
100+ tableId : PropTypes . string ,
96101 open : PropTypes . bool ,
97102 hidden : PropTypes . bool ,
98103 btnContextual : PropTypes . string ,
@@ -106,7 +111,8 @@ SizePerPageDropDown.defaultProps = {
106111 btnContextual : 'btn-default btn-secondary' ,
107112 variation : 'dropdown' ,
108113 className : '' ,
109- optionRenderer : null
114+ optionRenderer : null ,
115+ tableId : null
110116} ;
111117
112118
0 commit comments