@itwin/itwinui-react 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - d6d4d76e: Fixed an issue where TablePaginator buttons were causing postbacks when used inside a form.
8
+
3
9
  ## 2.4.0
4
10
 
5
11
  ### Minor Changes
@@ -58,7 +58,7 @@ const TablePaginator = (props) => {
58
58
  isMounted.current = true;
59
59
  }, [focusedIndex]);
60
60
  const buttonSize = size != 'default' ? 'small' : undefined;
61
- const pageButton = react_1.default.useCallback((index, tabIndex = index === focusedIndex ? 0 : -1) => (react_1.default.createElement("button", { key: index, className: (0, classnames_1.default)('iui-table-paginator-page-button', {
61
+ const pageButton = react_1.default.useCallback((index, tabIndex = index === focusedIndex ? 0 : -1) => (react_1.default.createElement("button", { key: index, type: 'button', className: (0, classnames_1.default)('iui-table-paginator-page-button', {
62
62
  'iui-table-paginator-page-button-small': buttonSize === 'small',
63
63
  }), "data-iui-active": index === currentPage, onClick: () => onPageChange(index), "aria-current": index === currentPage, "aria-label": localization.goToPageLabel(index + 1), tabIndex: tabIndex }, index + 1)), [focusedIndex, currentPage, localization, buttonSize, onPageChange]);
64
64
  const totalPagesCount = Math.ceil(totalRowsCount / pageSize);
@@ -52,7 +52,7 @@ export const TablePaginator = (props) => {
52
52
  isMounted.current = true;
53
53
  }, [focusedIndex]);
54
54
  const buttonSize = size != 'default' ? 'small' : undefined;
55
- const pageButton = React.useCallback((index, tabIndex = index === focusedIndex ? 0 : -1) => (React.createElement("button", { key: index, className: cx('iui-table-paginator-page-button', {
55
+ const pageButton = React.useCallback((index, tabIndex = index === focusedIndex ? 0 : -1) => (React.createElement("button", { key: index, type: 'button', className: cx('iui-table-paginator-page-button', {
56
56
  'iui-table-paginator-page-button-small': buttonSize === 'small',
57
57
  }), "data-iui-active": index === currentPage, onClick: () => onPageChange(index), "aria-current": index === currentPage, "aria-label": localization.goToPageLabel(index + 1), tabIndex: tabIndex }, index + 1)), [focusedIndex, currentPage, localization, buttonSize, onPageChange]);
58
58
  const totalPagesCount = Math.ceil(totalRowsCount / pageSize);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/itwinui-react",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "author": "Bentley Systems",
5
5
  "license": "MIT",
6
6
  "main": "cjs/index.js",