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

Editor: Don't hide authors' Combobox if the current author is missing #58719

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions packages/editor/src/components/post-author/combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { AUTHORS_QUERY } from './constants';
function PostAuthorCombobox() {
const [ fieldValue, setFieldValue ] = useState();

const { authorId, isLoading, authors, postAuthor } = useSelect(
const { authorId, authors, postAuthor } = useSelect(
( select ) => {
const { getUser, getUsers, isResolving } = select( coreStore );
const { getUser, getUsers } = select( coreStore );
const { getEditedPostAttribute } = select( editorStore );
const author = getUser( getEditedPostAttribute( 'author' ), {
context: 'view',
Expand All @@ -35,7 +35,6 @@ function PostAuthorCombobox() {
authorId: getEditedPostAttribute( 'author' ),
postAuthor: author,
authors: getUsers( query ),
isLoading: isResolving( 'core', 'getUsers', [ query ] ),
};
},
[ fieldValue ]
Expand Down Expand Up @@ -89,10 +88,6 @@ function PostAuthorCombobox() {
setFieldValue( inputValue );
};

if ( ! postAuthor ) {
return null;
}

return (
<ComboboxControl
__nextHasNoMarginBottom
Expand All @@ -102,7 +97,6 @@ function PostAuthorCombobox() {
value={ authorId }
onFilterValueChange={ debounce( handleKeydown, 300 ) }
onChange={ handleSelect }
isLoading={ isLoading }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ComboboxControl doesn't have a loading state.

allowReset={ false }
/>
);
Expand Down
Loading