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

EditInPlace keeps focused state when invalid but field is not actually focused on #5852

Closed
2 tasks done
David-Yuen opened this issue Aug 12, 2024 · 2 comments · Fixed by #5943
Closed
2 tasks done
Assignees
Labels
component: EditInPlace previously known as InlineEdit Sev 3 Visible or noticeable to users but does not impede functionality. Has a workaround. type: bug 🐛 Something isn't working

Comments

@David-Yuen
Copy link

Package

Carbon for IBM Products

Description

Normally, if you focus on the EditInPlace component to give input, the state of the component gets focused by adding class c4p--edit-in-place--focused, and when you click away (remove focus or focus on another component), the focused state is removed.

But when the component has invalid input and you click away, the EditInPlace component stays focused even when it's not actually focused anymore. The focused state should be removed when component is no longer focused on, regardless of the invalid state.

Component(s) impacted

EditInPlace component

Browser

Chrome

@carbon/ibm-products (previously @carbon/ibm-cloud-cognitive) version

2.46.0

Suggested Severity

Severity 2 = Aspects of design is broken, and impedes users in a significant way, but there is a way to complete their tasks. Affects major functionality, has a workaround.

Product/offering

IBM Cloud Data Replication

CodeSandbox or Stackblitz example

https://codesandbox.io/p/devbox/serene-wave-nlgmk5

Steps to reproduce the issue (if applicable)

Reproduced here: https://codesandbox.io/p/devbox/serene-wave-nlgmk5

Normal scenario

Not focused
Screenshot 2024-08-12 at 4 22 43 PM

Focused
Screenshot 2024-08-12 at 4 24 06 PM
^Clicking on EditInPlace component to edit, component is focused and c4p--edit-in-place--focused class is added.

Remove focus
Screenshot 2024-08-12 at 4 26 58 PM
Clicking away from EditInPlace component to remove focus, and c4p--edit-in-place--focused class is removed.

Bug scenario

Not focused
Starting with same scenario above with just "abc" input.. not focused on EditInPlace component.
Screenshot 2024-08-12 at 4 28 49 PM

Focused and create invalid scenario (add numbers)
Screenshot 2024-08-12 at 4 30 28 PM
^Clickin on EditInPlace component to edit, which focuses on the component and adds c4p--edit-in-place--focused class.
Then added "1" to input to go into invalid state. This additionally adds c4p--edit-in-place--invalid class.. Both classes exist now.

Remove focus
Screenshot 2024-08-12 at 4 33 30 PM
First, hit the Enter key to submit/save the changes (keeping the invalid value).
At this time, technically you are no longer focused on the EditInPlace component.. but click somewhere else anyways.
The component keeps both invalid and focused state, but really it's not focused anymore.
This screenshot seems like i am still focused on the EditInPlace component, but i'm not.. If i had other components on the page, i could be clicking and typing in other fields and this would still look like this.

Release date (if applicable)

No response

Code of Conduct

@github-project-automation github-project-automation bot moved this to Needs triage 🧐 in Carbon for IBM Products Aug 12, 2024
@matthewgallo matthewgallo added type: bug 🐛 Something isn't working component: EditInPlace previously known as InlineEdit Sev 3 Visible or noticeable to users but does not impede functionality. Has a workaround. and removed status: needs triage 🕵️‍♀️ labels Aug 14, 2024
@matthewgallo matthewgallo moved this from Needs triage 🧐 to Backlog 🌋 in Carbon for IBM Products Aug 14, 2024
@AlexanderMelox AlexanderMelox moved this from Backlog 🌋 to In progress in Carbon for IBM Products Aug 23, 2024
@AlexanderMelox
Copy link
Contributor

@David-Yuen Taking a look at this, I noticed in our build and locally I can't replicate the issue but i do notice it in Codesandbox

https://ibm-products.carbondesignsystem.com/?path=/story/ibm-products-patterns-edit-and-update-editinplace--invalid&globals=viewport:basic

@AlexanderMelox
Copy link
Contributor

Okay found a fix for this! That was easy 😅

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 Sev 3 Visible or noticeable to users but does not impede functionality. Has a workaround. type: bug 🐛 Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants