PLT-7313: Show help popover when search focused and empty. (#7134)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
bec6b90b8d
Коммит
82407bd44a
@@ -52,6 +52,11 @@ export default class SuggestionBox extends React.Component {
|
||||
*/
|
||||
completeOnTab: PropTypes.bool,
|
||||
|
||||
/**
|
||||
* Function called when input box gains focus
|
||||
*/
|
||||
onFocus: PropTypes.func,
|
||||
|
||||
/**
|
||||
* Function called when input box loses focus
|
||||
*/
|
||||
@@ -177,18 +182,21 @@ export default class SuggestionBox extends React.Component {
|
||||
}
|
||||
|
||||
handleFocus() {
|
||||
if (!this.props.openOnFocus) {
|
||||
return;
|
||||
}
|
||||
setTimeout(() => {
|
||||
const textbox = this.getTextbox();
|
||||
if (textbox) {
|
||||
const pretext = textbox.value.substring(0, textbox.selectionEnd);
|
||||
if (pretext.length >= this.props.requiredCharacters) {
|
||||
GlobalActions.emitSuggestionPretextChanged(this.suggestionId, pretext);
|
||||
if (this.props.openOnFocus) {
|
||||
setTimeout(() => {
|
||||
const textbox = this.getTextbox();
|
||||
if (textbox) {
|
||||
const pretext = textbox.value.substring(0, textbox.selectionEnd);
|
||||
if (pretext.length >= this.props.requiredCharacters) {
|
||||
GlobalActions.emitSuggestionPretextChanged(this.suggestionId, pretext);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (this.props.onFocus) {
|
||||
this.props.onFocus();
|
||||
}
|
||||
}
|
||||
|
||||
handleChange(e) {
|
||||
|
||||
Ссылка в новой задаче
Block a user