@ckeditor/ckeditor5-ui 43.1.1 → 43.2.0-alpha.0

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/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import { Collection, CKEditorError, EmitterMixin, isNode, toArray, DomEmitterMixin, ObservableMixin, isIterable, uid, env, delay, getEnvKeystrokeText, isVisible, global, KeystrokeHandler, FocusTracker, Rect, toUnit, createElement, ResizeObserver, getBorderWidths, logWarning, getOptimalPosition, isText, isRange, priorities, first, verifyLicense } from '@ckeditor/ckeditor5-utils/dist/index.js';
5
+ import { Collection, CKEditorError, EmitterMixin, isNode, toArray, DomEmitterMixin, ObservableMixin, isIterable, uid, env, delay, getEnvKeystrokeText, isVisible, global, KeystrokeHandler, FocusTracker, Rect, toUnit, createElement, ResizeObserver, getBorderWidths, logWarning, getOptimalPosition, isText, isRange, priorities, first, verifyLicense, getAncestors } from '@ckeditor/ckeditor5-utils/dist/index.js';
6
6
  import { cloneDeepWith, isObject, isElement, debounce, throttle, cloneDeep, extend, escapeRegExp, escape } from 'lodash-es';
7
7
  import { icons, Plugin, ContextPlugin } from '@ckeditor/ckeditor5-core/dist/index.js';
8
8
  import parse from 'color-parse';
@@ -16780,10 +16780,19 @@ const toPx = /* #__PURE__ */ toUnit('px');
16780
16780
  const { buttonView } = this;
16781
16781
  let pendingAnimationFrame = false;
16782
16782
  // Reposition the button on scroll, but do it only once per animation frame to avoid performance issues.
16783
- const repositionOnScroll = ()=>{
16783
+ const repositionOnScroll = (evt, domEvt)=>{
16784
16784
  if (pendingAnimationFrame) {
16785
16785
  return;
16786
16786
  }
16787
+ // It makes no sense to reposition the button when the user scrolls the dropdown or any other
16788
+ // nested scrollable element. The button should be repositioned only when the user scrolls the
16789
+ // editable or any other scrollable parent of the editable. Leaving it as it is buggy on Chrome
16790
+ // where scrolling nested scrollables is not properly handled.
16791
+ // See more: https://github.com/ckeditor/ckeditor5/issues/17067
16792
+ const editableElement = this._getSelectedEditableElement();
16793
+ if (domEvt.target !== global.document && !getAncestors(editableElement).includes(domEvt.target)) {
16794
+ return;
16795
+ }
16787
16796
  pendingAnimationFrame = true;
16788
16797
  global.window.requestAnimationFrame(()=>{
16789
16798
  this._updateButton();