Skip to content

Commit 3dcda6b

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents 91b12ef + ae54b3e commit 3dcda6b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

kernel/model/attribute_view.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ func GetAttrViewAddingBlockDefaultValues(avID, viewID, groupID, previousBlockID,
7373
}
7474

7575
ret = getAttrViewAddingBlockDefaultValues(attrView, view, groupView, previousBlockID, addingBlockID)
76+
for _, value := range ret {
77+
// 主键都不返回内容,避免闪烁 https://github.com/siyuan-note/siyuan/issues/15561#issuecomment-3184746195
78+
if av.KeyTypeBlock == value.Type {
79+
value.Block.Content = ""
80+
}
81+
}
7682
return
7783
}
7884

@@ -4718,6 +4724,12 @@ func updateAttributeViewColumnOptions(operation *Operation) (err error) {
47184724
return
47194725
}
47204726

4727+
optionSorts := map[string]int{}
4728+
for i, opt := range options {
4729+
optionSorts[opt.Name] = i
4730+
}
4731+
4732+
addNew := false
47214733
selectKey, _ := attrView.GetKey(operation.ID)
47224734
if nil == selectKey {
47234735
return
@@ -4738,9 +4750,16 @@ func updateAttributeViewColumnOptions(operation *Operation) (err error) {
47384750
Color: opt.Color,
47394751
Desc: opt.Desc,
47404752
})
4753+
addNew = true
47414754
}
47424755
}
47434756

4757+
if !addNew {
4758+
sort.SliceStable(selectKey.Options, func(i, j int) bool {
4759+
return optionSorts[selectKey.Options[i].Name] < optionSorts[selectKey.Options[j].Name]
4760+
})
4761+
}
4762+
47444763
regenAttrViewGroups(attrView, operation.ID)
47454764
err = av.SaveAttributeView(attrView)
47464765
return

0 commit comments

Comments
 (0)