mirror of
https://github.com/desktop/desktop
synced 2024-09-19 08:02:22 +00:00
Merge branch 'development' into cherry-picking-continue-after-conflicts
This commit is contained in:
commit
adac27d087
|
@ -87,6 +87,7 @@ const imageFileExtensions = new Set([
|
|||
'.ico',
|
||||
'.webp',
|
||||
'.bmp',
|
||||
'.avif',
|
||||
])
|
||||
|
||||
/**
|
||||
|
@ -299,6 +300,9 @@ function getMediaType(extension: string) {
|
|||
if (extension === '.bmp') {
|
||||
return 'image/bmp'
|
||||
}
|
||||
if (extension === '.avif') {
|
||||
return 'image/avif'
|
||||
}
|
||||
|
||||
// fallback value as per the spec
|
||||
return 'text/plain'
|
||||
|
|
|
@ -121,6 +121,8 @@ export class CommitMessage extends React.Component<
|
|||
private descriptionTextArea: HTMLTextAreaElement | null = null
|
||||
private descriptionTextAreaScrollDebounceId: number | null = null
|
||||
|
||||
private coAuthorInputRef = React.createRef<AuthorInput>()
|
||||
|
||||
public constructor(props: ICommitMessageProps) {
|
||||
super(props)
|
||||
const { commitMessage } = this.props
|
||||
|
@ -180,6 +182,14 @@ export class CommitMessage extends React.Component<
|
|||
|
||||
if (this.props.focusCommitMessage) {
|
||||
this.focusSummary()
|
||||
} else if (
|
||||
prevProps.showCoAuthoredBy === false &&
|
||||
this.isCoAuthorInputVisible &&
|
||||
// The co-author input could be also shown when switching between repos,
|
||||
// but in that case we don't want to give the focus to the input.
|
||||
prevProps.repository.id === this.props.repository.id
|
||||
) {
|
||||
this.coAuthorInputRef.current?.focus()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -344,6 +354,7 @@ export class CommitMessage extends React.Component<
|
|||
|
||||
return (
|
||||
<AuthorInput
|
||||
ref={this.coAuthorInputRef}
|
||||
onAuthorsUpdated={this.onCoAuthorsUpdated}
|
||||
authors={this.props.coAuthors}
|
||||
autoCompleteProvider={autocompletionProvider}
|
||||
|
|
|
@ -467,6 +467,10 @@ export class AuthorInput extends React.Component<IAuthorInputProps, {}> {
|
|||
this.state = {}
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.editor?.focus()
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
// Sometimes the completion box seems to fail to register
|
||||
// the blur event and close. It's hard to reproduce so
|
||||
|
|
Loading…
Reference in a new issue