Fix being able to add more than 4 hashtags to hashtag column in web UI (#17729)

signup-info-prompt
Eugen Rochko 2022-03-09 13:01:44 +01:00 committed by GitHub
parent db04dfc8a6
commit e54fd73df2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -40,7 +40,17 @@ class ColumnSettings extends React.PureComponent {
}
};
onSelect = mode => value => this.props.onChange(['tags', mode], value);
onSelect = mode => value => {
const oldValue = this.tags(mode);
// Prevent changes that add more than 4 tags, but allow removing
// tags that were already added before
if ((value.length > 4) && !(value < oldValue)) {
return;
}
this.props.onChange(['tags', mode], value);
};
onToggle = () => {
if (this.state.open && this.hasTags()) {