Avoid going over the maximum allowed number of poll responses
This commit is contained in:
parent
9d4bd0e199
commit
11fe501214
@ -245,6 +245,8 @@ class Poll extends Component {
|
||||
|
||||
setOptListLength(len) {
|
||||
const { optList } = this.state;
|
||||
|
||||
len = len > MAX_CUSTOM_FIELDS ? MAX_CUSTOM_FIELDS : len;
|
||||
const diff = len - optList.length;
|
||||
if (diff > 0) {
|
||||
const emptyAddition = Array(diff).fill({ val: '' });
|
||||
|
Loading…
Reference in New Issue
Block a user