-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Post visibility better html and a11y #1361
Conversation
OK so I've just noticed a (pre-existing) bug: |
I think this was inspired by Calypso's implementation, which prompts the user to immediately publish the post. It was a workaround to an issue caused by Calypso's "noisy" autosave, where drafts are saved very frequently without user intervention (i.e. don't need to press "Save Draft"). It's an issue because you can't save a draft with "Privately Published" as the status (since private and draft are mutually exclusive statuses). In wp-admin this is pretty unexpected as well:
Expected: A draft is saved Depending on the direction we take with #1773, we might need something like this with Gutenberg as well. Or: a way to respect that a user wants the post to be published privately in draft meta. Or: autosave excluding status. |
Should the panel also close when focus leaves (guessing yes)? Example: Press tab while focused in the password input moves to the next Post Settings field, but the panel remains open. |
@@ -56,8 +56,8 @@ class PostVisibility extends Component { | |||
const { onUpdateVisibility, onSave } = this.props; | |||
|
|||
onUpdateVisibility( 'private' ); | |||
this.setState( { hasPassword: 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.
Outside the scope of this pull request, but I don't like how we have to manually manage password state. Seems like it should be inferred by the password
prop, or at least consolidated to one of the lifecycle methods (e.g. componentWillUpdate
). I might plan to tackle this separately.
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.
I'd agree it should be addressed separately.
<div key={ value } className="editor-post-visibility__choice"> | ||
<input | ||
type="radio" | ||
name="editor-post-visibility__setting" |
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 likely we'd have more than one of these components on the page, but given that we're injecting instanceId
anyways, maybe we should include it in the input name?
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.
Will try.
Yeah, I guess it should.
I understand. I can only say that from an usability and accessibility perspective the JS confirm is a terrible experience 🙂 I'd really like to try a different mechanism here, but it makes sense to postpone this issue, pending decisions on autosave. |
Added |
…oad-progress Move MediaUploadPorgress to its own component folder
This PR tries to improve the Post Visibility "popover" HTML semantic and accessibility:
Not sure why
setPrivate()
usesonSave()
, would need some feedback here since that seems to trigger a re-rendering of the "popover". /cc @aduthTodo:
These points should probably be addressed in #1204 as @aduth mentioned
Note: Needs to be tested in IE/Edge (I suspect the legend element would need some additional styling for those browsers)
Fixes #1312