-
-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in repeater buttons #6525
Conversation
Problem: Currently, when reaching the `limit` in a repeater definition, the [Add new Repeater set] button gets grayed out but clicking it still adds a new repeater set, and the [Duplicate set] button also gets wrongly grayed out. Fix: The `.disabled` class was being applied to the [Duplicate set] button, instead of adding the “disabled” property to the [Add new Repeater set] button.
@@ -246,10 +246,10 @@ | |||
|
|||
if (this._count >= this.options.maximum) { | |||
this._ui.add.addClass('disabled'); | |||
this.element.find('.duplicate-button').addClass('disabled'); | |||
this._ui.add.prop('disabled', 'disabled'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add this line underneath:
this.element.find('.duplicate-button').prop('disabled', 'disabled');
} else { | ||
this._ui.add.removeClass('disabled'); | ||
this.element.find('.duplicate-button').removeClass('disabled'); | ||
this._ui.add.prop('disabled', false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this line underneath here:
this.element.find('.duplicate-button').prop('disabled', false);
@ross I should have known that, thanks for catching it! |
I think you want @rossriley |
@ross you're right, sorry, I am used to his Slack handle :-) |
- make sure ‘duplicate set’ button is disabled when max repeaters are reached - make sure ‘delete set’ button is disabled when minimum is reached
I updated the files. Just pinging you since I am not sure you got a notification from git, I didn't. |
@rossriley This should be GTG now, right? |
Problem:
Currently, when reaching the
limit
set in a repeater definition, the [Add new Repeater set] button gets grayed out but clicking it still adds a new repeater set, and the [Duplicate set] button gets wrongly grayed out.Fix:
The
.disabled
class was being applied to the [Duplicate set] buttons, instead of adding the“disabled”
property to the [Add new Repeater set] button.