@progress/kendo-react-scheduler 5.1.0-dev.202202281430 → 5.1.1-dev.202203280712

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.
@@ -39,6 +39,7 @@ export var SchedulerViewItem = React.forwardRef(function (props, ref) {
39
39
  var timeout = React.useRef();
40
40
  var item = React.useRef(null);
41
41
  var viewItem = React.useRef(null);
42
+ var schedulerRect = React.useRef(null);
42
43
  React.useImperativeHandle(viewItem, function () { return ({ props: props, element: item.current && item.current.element }); });
43
44
  React.useImperativeHandle(ref, function () { return viewItem.current; });
44
45
  React.useImperativeHandle(_ref, function () { return item.current; });
@@ -167,14 +168,21 @@ export var SchedulerViewItem = React.forwardRef(function (props, ref) {
167
168
  setVisible(true);
168
169
  setDisplay(true);
169
170
  };
170
- var handleResize = React.useCallback(function () {
171
+ var handleResize = React.useCallback(function (entries) {
172
+ var entry = entries && entries[0];
173
+ var rect = schedulerRect.current;
171
174
  if (timeout.current !== undefined) {
172
175
  window.cancelAnimationFrame(timeout.current);
173
176
  }
174
- timeout.current = window.requestAnimationFrame(function () {
175
- align();
176
- position();
177
- });
177
+ if (rect && entry &&
178
+ (rect.width !== entry.contentRect.width ||
179
+ rect.height !== entry.contentRect.height)) {
180
+ timeout.current = window.requestAnimationFrame(function () {
181
+ align();
182
+ position();
183
+ });
184
+ }
185
+ schedulerRect.current = { width: entry.contentRect.width, height: entry.contentRect.height };
178
186
  }, [align, position]);
179
187
  React.useEffect(align);
180
188
  React.useEffect(position);
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-react-scheduler',
6
6
  productName: 'KendoReact',
7
7
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1646058326,
8
+ publishDate: 1648451208,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
11
11
  };
@@ -41,6 +41,7 @@ exports.SchedulerViewItem = React.forwardRef(function (props, ref) {
41
41
  var timeout = React.useRef();
42
42
  var item = React.useRef(null);
43
43
  var viewItem = React.useRef(null);
44
+ var schedulerRect = React.useRef(null);
44
45
  React.useImperativeHandle(viewItem, function () { return ({ props: props, element: item.current && item.current.element }); });
45
46
  React.useImperativeHandle(ref, function () { return viewItem.current; });
46
47
  React.useImperativeHandle(_ref, function () { return item.current; });
@@ -169,14 +170,21 @@ exports.SchedulerViewItem = React.forwardRef(function (props, ref) {
169
170
  setVisible(true);
170
171
  setDisplay(true);
171
172
  };
172
- var handleResize = React.useCallback(function () {
173
+ var handleResize = React.useCallback(function (entries) {
174
+ var entry = entries && entries[0];
175
+ var rect = schedulerRect.current;
173
176
  if (timeout.current !== undefined) {
174
177
  window.cancelAnimationFrame(timeout.current);
175
178
  }
176
- timeout.current = window.requestAnimationFrame(function () {
177
- align();
178
- position();
179
- });
179
+ if (rect && entry &&
180
+ (rect.width !== entry.contentRect.width ||
181
+ rect.height !== entry.contentRect.height)) {
182
+ timeout.current = window.requestAnimationFrame(function () {
183
+ align();
184
+ position();
185
+ });
186
+ }
187
+ schedulerRect.current = { width: entry.contentRect.width, height: entry.contentRect.height };
180
188
  }, [align, position]);
181
189
  React.useEffect(align);
182
190
  React.useEffect(position);
@@ -7,7 +7,7 @@ exports.packageMetadata = {
7
7
  name: '@progress/kendo-react-scheduler',
8
8
  productName: 'KendoReact',
9
9
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
10
- publishDate: 1646058326,
10
+ publishDate: 1648451208,
11
11
  version: '',
12
12
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
13
13
  };