-
Notifications
You must be signed in to change notification settings - Fork 435
Adds an Inline Edit component #336
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
Adds an Inline Edit component #336
Conversation
Looks good. Will it be keyboard accessible? |
@minevskiy It's current accessible with the following behavior: you can tab to the edit button, and hitting enter will take you to the input. Hitting tab when you finish typing will return the input to read-only state. Hitting enter will not currently end editing mode, not sure if it should or not. Maybe @SiTaggart would have some feedback on additional accessibility needs? FYI to anyone looking into this, you can get to the live example here. |
@tweettypography , We have the following requirement from @jhausler1266 : |
@minevskiy Updated to return to read-only mode on hitting escape, but it'd be to the consuming application to not save the changes if that's what you mean by cancel. Is the requirement that you have that this component should revert to original state when hitting escape? In that case should there be a close button (like an "x" icon) in the input while it's active to indicate it's cancellable? |
Note: merge #337 first as this one will likely need to be updated slightly once that goes in. |
Yes, on ESC, the input should revert to original state. And, according to W-2807690, there should also be a cancel button somewhere. |
@minevskiy is there a place where we can learn more about W-2807690? Is that a documented accessibility standard? Would adding a "close" icon to the input appropriately address this issue? |
@jamin-hall , for more information on accessibility standard for inline input, please reach out to @jhausler1266 or @SiTaggart |
# Conflicts: # components/forms/input/check-props.js
@minevskiy / @jamin-hall: This should be ready for final review now. The close button itself isn't reachable via keyboard, but that's an accessibility bug with Input and when #315 is fixed it should fix this component too. |
@tweettypography looks good. |
How would a consuming application determine that an edit was cancelled? |
@minevskiy Actually, cancelling is an unresolved issue - it sounds like based on our previous conversation I should rework this to not send the updated value until the edit ends (but is not cancelled). Is that correct? |
As for click locations -- current SLDS behavior is that inputs are set to 100% of their container width. So if you wanted a smaller hit area you would out the input in a smaller container. I'm not sure exactly how we would change that without adding additional markup or changing the SLDS markup. Thoughts? |
@tweettypography , yes, ideally, it should not send the updated value until the edit ends. |
@minevskiy Updated to follow this pattern |
Actually, looks like with the latest updates the |
looks good to me otherwise |
@jwilcurt-salesforce-com what happens when you click add? |
Pop-over shows up for Description, for campaigns it will be a multi selection. |
@jwilcurt-salesforce-com Looks that is a different pattern than the one covered by this component. You should be able to implement it already with the Popover component though. |
# Conflicts: # stories/index.js
I was not referring to that, I was just answering your question. I am refering to the underline with the pencil and the large font "2016 Outdoors Rewards M..." "Untitled Audiences" Currently I have no means to create this without custom markup, css, and js. |
@jwilcurt-salesforce-com Sorry! I was looking at on my phone and the line / icon were low enough contrast that I didn't even see them. I wonder if that's an accessibility issue. Anyway, the line is actually a default part of input and I intentionally disabled it because it wasn't in the the designs I received. Can you have the designer who gave you that reach out to me? As for size - you can add the class |
@minevskiy This should be ready for review now with the cancel button working properly |
props.iconName = 'close'; | ||
props.iconPosition = 'right'; | ||
props.onIconClick = this.endEditMode; | ||
props.onIconMouseDown = this.handleIconMouseDown; |
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.
Where is handleIconMouseDown
defined?
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.
It's not, good catch. That was left over from testing alternative methods to work around the onBlur
/ onClick
issues.
looks good. Thanks @tweettypography ! |
Fixes #153
@jamin-hall / @minevskiy Still working on some cleanup here, but I'm opening a PR so you can take a look and let me know your feedback on the component.