@handaotech-design/bom 0.0.47 → 0.0.48

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.
@@ -116,9 +116,13 @@ async function locateNodeByKey(targetKey: string) {
116
116
  key: targetKey,
117
117
  align: 'top',
118
118
  })
119
- focusNode(targetKey)
119
+ setTimeout(() => {
120
+ focusNode(targetKey)
121
+ }, 0) // 延时足够滚动完成
120
122
  requestAnimationFrame(() => {
121
- isProgrammaticScroll = false
123
+ setTimeout(() => {
124
+ isProgrammaticScroll = false
125
+ }, 500) // 延时足够滚动完成
122
126
  })
123
127
  }
124
128
 
@@ -363,7 +367,7 @@ async function _loadData(node: EventDataNode) {
363
367
 
364
368
  function focusNode(key: string) {
365
369
  // 先清理页面上已有的焦点动画
366
- document.querySelectorAll<HTMLElement>('.tree-node-tittle.focus-flash').forEach(el => {
370
+ document.querySelectorAll<HTMLElement>('.tree-node-tittle.focus-flash').forEach((el) => {
367
371
  el.classList.remove('focus-flash')
368
372
  })
369
373
  // 1. 用 antd Tree 自带滚动
@@ -116,9 +116,13 @@ async function locateNodeByKey(targetKey: string) {
116
116
  key: targetKey,
117
117
  align: 'top',
118
118
  })
119
- focusNode(targetKey)
119
+ setTimeout(() => {
120
+ focusNode(targetKey)
121
+ }, 0) // 延时足够滚动完成
120
122
  requestAnimationFrame(() => {
121
- isProgrammaticScroll = false
123
+ setTimeout(() => {
124
+ isProgrammaticScroll = false
125
+ }, 500) // 延时足够滚动完成
122
126
  })
123
127
  }
124
128
 
@@ -363,7 +367,7 @@ async function _loadData(node: EventDataNode) {
363
367
 
364
368
  function focusNode(key: string) {
365
369
  // 先清理页面上已有的焦点动画
366
- document.querySelectorAll<HTMLElement>('.tree-node-tittle.focus-flash').forEach(el => {
370
+ document.querySelectorAll<HTMLElement>('.tree-node-tittle.focus-flash').forEach((el) => {
367
371
  el.classList.remove('focus-flash')
368
372
  })
369
373
  // 1. 用 antd Tree 自带滚动
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handaotech-design/bom",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "exports": {