-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Document Settings: Make Post Format, Slug and Author fields fill the sidebar #42146
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
.editor-post-author__select { | ||
margin: -5px 0; | ||
|
||
// Set the width of the author select box in IE11 to prevent it overflowing | ||
// outside of the container because of IE11 flexbox bugs. | ||
// We reset it to `width: auto;` for non-IE11 browsers. | ||
width: 100%; | ||
@supports (position: sticky) { | ||
width: auto; | ||
} | ||
.edit-post-post-author { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: stretch; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.edit-post-post-format { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: stretch; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.editor-post-slug__input { | ||
margin: -5px 0; | ||
padding: 2px; | ||
.edit-post-post-slug { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: stretch; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,3 @@ | ||
.editor-post-format { | ||
flex-direction: column; | ||
align-items: stretch; | ||
width: 100%; | ||
} | ||
|
||
.editor-post-format__content { | ||
display: inline-flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
width: 100%; | ||
} | ||
|
||
.editor-post-format__suggestion { | ||
padding: $grid-unit-15 * 0.5; | ||
text-align: right; | ||
font-size: $default-font-size; | ||
[class].editor-post-format__suggestion { | ||
margin: $grid-unit-05 0 0 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import { Component } from '@wordpress/element'; | |
import { __ } from '@wordpress/i18n'; | ||
import { withInstanceId, compose } from '@wordpress/compose'; | ||
import { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url'; | ||
import { TextControl } from '@wordpress/components'; | ||
|
||
/** | ||
* Internal dependencies | ||
|
@@ -41,25 +42,19 @@ export class PostSlug extends Component { | |
} | ||
|
||
render() { | ||
const { instanceId } = this.props; | ||
Mamaduka marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const { editedSlug } = this.state; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The slug change from URL form isn't reflected in the slug text field without page refresh. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this bug exists on For context I think this component was added back when we used the post editor for templates and template parts but was never removed and now we're stuck maintaining it. In theory a plugin can add |
||
|
||
const inputId = 'editor-post-slug-' + instanceId; | ||
|
||
return ( | ||
<PostSlugCheck> | ||
<label htmlFor={ inputId }>{ __( 'Slug' ) }</label> | ||
<input | ||
<TextControl | ||
label={ __( 'Slug' ) } | ||
autoComplete="off" | ||
spellCheck="false" | ||
type="text" | ||
id={ inputId } | ||
value={ editedSlug } | ||
onChange={ ( event ) => | ||
this.setState( { editedSlug: event.target.value } ) | ||
onChange={ ( slug ) => | ||
this.setState( { editedSlug: slug } ) | ||
} | ||
onBlur={ this.setSlug } | ||
className="editor-post-slug__input" | ||
className="editor-post-slug" | ||
/> | ||
</PostSlugCheck> | ||
); | ||
|
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.
This appears to be dead code.