want to achieve the effect in the following figure:
there are multiple tags, each of which is of different length, and they are arranged freely. When more than two lines are arranged, the rest are automatically hidden, and the expand button is displayed at this time.
I know how to hide the rest more than two lines, but how can I tell if these tags have more than two lines?
A line may leave a lot of space because there is not enough space left for the next label to fill. In short, this free arrangement is not good to judge the number of lines by the number of words, and ask for some suggestions!