Skip to content
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

'Save' button for an action is automatically disabled in UI #340

Closed
Ankit-Singla opened this issue Sep 27, 2018 · 16 comments · Fixed by #562
Closed

'Save' button for an action is automatically disabled in UI #340

Ankit-Singla opened this issue Sep 27, 2018 · 16 comments · Fixed by #562
Assignees

Comments

@Ankit-Singla
Copy link

The 'Save' button is automatically disabled whenever a new action/process is applied on any image, or after some parameters are changed and the 'Save' button is clicked. It requires being clicked two times on changing values of parameters, as it does not get autofocus when the values are changed.
@tech4GT @jywarren

@gitmate
Copy link

gitmate bot commented Sep 27, 2018

GitMate.io thinks the contributor most likely able to help you is @jywarren.

Possibly related issues are #303 (Disable/dim the Add step button until a module is selected), and #302 (Disable/dim the Save button until step inputs have been changed).

1 similar comment
@gitmate
Copy link

gitmate bot commented Sep 27, 2018

GitMate.io thinks the contributor most likely able to help you is @jywarren.

Possibly related issues are #303 (Disable/dim the Add step button until a module is selected), and #302 (Disable/dim the Save button until step inputs have been changed).

@tech4GT
Copy link
Member

tech4GT commented Sep 27, 2018

hmm, yes this appears to be a problem, I think we should enable the save button on "focus" based event. Thanks for pointing out @Ankit-Singla
Would you like to work on this issue?

@Ankit-Singla
Copy link
Author

Yes, I would love to give it a try.

@jywarren
Copy link
Member

Merging with #377!

@tech4GT
Copy link
Member

tech4GT commented Dec 26, 2018

Okay, this is still not fixed reopening this!

@tech4GT tech4GT reopened this Dec 26, 2018
@harshkhandeparkar
Copy link
Member

harshkhandeparkar commented Dec 26, 2018

The buttons works but only when the input field is updated .on('change') . That only happens when copy-paste is complete and input field is defocused or if the input field has increment and decrement buttons and they are clicked type=number. The input field doesn't receive an update while typing, it only updates after typing is complete.

@tech4GT
Copy link
Member

tech4GT commented Dec 26, 2018

Hmm, harsh I was expecting behavior where we don't have to shift focus after changing the field to enable the button.

@tech4GT
Copy link
Member

tech4GT commented Dec 26, 2018

Yeah that's what we would like fixed :)

@harshkhandeparkar
Copy link
Member

harshkhandeparkar commented Dec 26, 2018

If we add a .on('focus') event listener then the button gets focused even when the input has not changed.

@tech4GT
Copy link
Member

tech4GT commented Dec 26, 2018

Hmm, I don't think that's going to cut it since we want to enable it only when the value is changed. Maybe this needs some research work!

@harshkhandeparkar
Copy link
Member

I think a onKeyUp or similar event listener would work but change in values should be taken into account

@tech4GT
Copy link
Member

tech4GT commented Dec 26, 2018

Harsh I think we would need to make a custom function for this, this kind of functionality usually exists in frameworks like vue and react so we can take some inspiration from there I guess.

@harshkhandeparkar
Copy link
Member

harshkhandeparkar commented Dec 26, 2018

Or we can get the initial value when the field is focused and compare it onkeyup or onchange.

@harshkhandeparkar
Copy link
Member

harshkhandeparkar commented Dec 26, 2018


inputfield.on('focus', function() {
    var initValue = inputfield.value;
    inputfield.on('change/keyup', function() {
         focusButton(initValue);
    };
};

function focusButton(initValue) {
    if (inputfield.value != initValue) {
         saveButton.focus();
    };
};

@harshkhandeparkar
Copy link
Member

harshkhandeparkar commented Dec 26, 2018

I'm trying to fix this. I'll open a PR tomorrow and we will discuss this there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants