linear-react-components-ui 1.1.2-beta.6 → 1.1.2-beta.7

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.
@@ -121,32 +121,9 @@ const BaseDialog = props => {
121
121
  }, children)));
122
122
  (0, _react.useEffect)(() => {
123
123
  if (open) {
124
- var _wrapperEl$current;
125
124
  if (closeOnEsc) {
126
125
  document.addEventListener('keydown', handleCloseOnEsc);
127
126
  }
128
- const modalContent = (_wrapperEl$current = wrapperEl.current) === null || _wrapperEl$current === void 0 ? void 0 : _wrapperEl$current.querySelector('#modal-dialog-content');
129
- const modalElementsForTrapFocus = (modalContent === null || modalContent === void 0 ? void 0 : modalContent.querySelectorAll('[href], select, textarea, button, input:not([disabled]), [tabindex]:not([tabindex="-1"])')) || [];
130
- if (wrapperEl && wrapperEl.current && modalElementsForTrapFocus.length) {
131
- const firstElementInModal = modalElementsForTrapFocus[0];
132
- let lastElementInModal = modalElementsForTrapFocus[modalElementsForTrapFocus.length - 1];
133
- const handleTabKeyPress = event => {
134
- if (event.key === 'Tab') {
135
- if (event.shiftKey && document.activeElement === firstElementInModal) {
136
- event.preventDefault();
137
- lastElementInModal.focus();
138
- } else if (!event.shiftKey && document.activeElement === lastElementInModal) {
139
- event.preventDefault();
140
- firstElementInModal.focus();
141
- }
142
- }
143
- };
144
- wrapperEl.current.addEventListener('keydown', handleTabKeyPress);
145
- return () => {
146
- var _wrapperEl$current2;
147
- (_wrapperEl$current2 = wrapperEl.current) === null || _wrapperEl$current2 === void 0 ? void 0 : _wrapperEl$current2.removeEventListener('keydown', handleTabKeyPress);
148
- };
149
- }
150
127
  }
151
128
  return () => {
152
129
  document.removeEventListener('keydown', handleCloseOnEsc);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.1.2-beta.6",
3
+ "version": "1.1.2-beta.7",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",