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

[Feature Request]: EditInPlace, add an onblur function #5148

Open
2 tasks done
AustinGitHub opened this issue May 10, 2024 · 5 comments
Open
2 tasks done

[Feature Request]: EditInPlace, add an onblur function #5148

AustinGitHub opened this issue May 10, 2024 · 5 comments
Labels
component: EditInPlace previously known as InlineEdit needs: design opinion Design question needs opinion from designer needs: ux status: needs triage 🕵️‍♀️

Comments

@AustinGitHub
Copy link
Contributor

The problem

Currently, when you click out of the text input, if you made any changes, it will persist that change instead of reverting back to the original text. User hasn't hit save yet, so it saves anyways for the onblur

Screen.Recording.2024-05-09.at.4.11.28.PM.mov

The solution

Add an onblur event action so user can add this to the component props and have their own way to decide what action it should do when on Blur/Clicking out of the edit will do.

Design link

No response

Links to other materials

No response

Owner/main maintainer(s)

IBM

Second/backup maintainer(s)

No response

Product/offering

No response

Business priority

Medium Priority = upcoming release but is not pressing

Code of Conduct

@elycheea elycheea added needs: ux needs: design opinion Design question needs opinion from designer component: EditInPlace previously known as InlineEdit labels May 14, 2024
@thefirstartist
Copy link

@AustinGitHub
I think providing the onBlur event may not be the best solution for resolving this issue. If we allow users to keep the changes in the text field without clicking the 'Save' button, then it functions just like a regular text input field. In that case, users should simply use the regular text input field instead of this component.

Additionally, allowing the product team to choose what they want could lead to potential inconsistencies among our products.

@AustinGitHub
Copy link
Contributor Author

Then can we have some way to indicate how the user left the input field whether it was from clicking out or from the save? Because some UI designs might want it to not save if user clicks out if they didn't hit the save button but there isn't a way to know what behavior was taken. Thanks!

@thefirstartist
Copy link

I think clicking outside of the text field is equivalent to giving up on the editing process. We discard the changes and return the data to its original state. The only way to retain the changes is by clicking the save button.

Most design systems use the 'X' button in this type of component to represent 'Clear.' Therefore, clicking outside the component cancels the action, while clicking the 'X' button inside the field clears the content. This approach tends to be more intuitive for users. It's okay if we want to use the 'X' for cancel, but clicking outside should definitely be Cancel.

@AustinGitHub
Copy link
Contributor Author

So then we are in agreement then? I am a bit confused because this I think clicking outside of the text field is equivalent to giving up on the editing process. We discard the changes and return the data to its original state is currently not the case for this component. That is the main issue I am pointing at

@thefirstartist
Copy link

Yes, we are in agreement. What I was suggesting is not to provide the option for designer to have their own way to decide what action it should do to avoid inconsistencies. Clicking outside to cancel should be mandatory, not optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: EditInPlace previously known as InlineEdit needs: design opinion Design question needs opinion from designer needs: ux status: needs triage 🕵️‍♀️
Projects
Status: Needs triage 🧐
Development

No branches or pull requests

3 participants