Skip to content

Commit

Permalink
Fix Add Limit.
Browse files Browse the repository at this point in the history
Problem: When limit > value it's return FieldModel, and in view rendering FieldModel struct with all properties.
Solution: return value.Value
  • Loading branch information
Sergey Oleynik committed Jun 9, 2021
1 parent b26e642 commit 99da3c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion template/types/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (f FieldDisplay) ToDisplayStringArrayArray(value FieldModel) [][]string {
func (f FieldDisplay) AddLimit(limit int) DisplayProcessFnChains {
return f.DisplayProcessChains.Add(func(value FieldModel) interface{} {
if limit > len(value.Value) {
return value
return value.Value
} else if limit < 0 {
return ""
} else {
Expand Down

0 comments on commit 99da3c6

Please sign in to comment.