@douyinfe/semi-ui 2.38.1 → 2.38.2-alpha.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.
@@ -17854,9 +17854,14 @@ class AnchorFoundation extends foundation {
17854
17854
  */
17855
17855
  behavior: actions => {
17856
17856
  // We just need to scroll the innermost target container
17857
- const innermostAction = get_default()(actions, '0');
17858
- const el = get_default()(innermostAction, 'el');
17859
- const top = get_default()(innermostAction, 'top');
17857
+ const verticalScrollAction = actions.find(action => {
17858
+ const {
17859
+ el
17860
+ } = action;
17861
+ return el.scrollHeight > el.clientHeight;
17862
+ });
17863
+ const el = get_default()(verticalScrollAction, 'el');
17864
+ const top = get_default()(verticalScrollAction, 'top');
17860
17865
  if (el) {
17861
17866
  const offsetTop = top - targetOffset;
17862
17867
  if (el.scroll && canSmoothScroll) {