You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-20 16:22:28 +03:00
Add back on..Arrow functions. Add left/right key navigation in MessageEditor
This commit is contained in:
@@ -116,6 +116,10 @@ export default class MessageEditor extends React.Component {
|
|||||||
autoComplete.onUpArrow(event); break;
|
autoComplete.onUpArrow(event); break;
|
||||||
case "ArrowDown":
|
case "ArrowDown":
|
||||||
autoComplete.onDownArrow(event); break;
|
autoComplete.onDownArrow(event); break;
|
||||||
|
case "ArrowLeft":
|
||||||
|
autoComplete.onLeftArrow(event); break;
|
||||||
|
case "ArrowRight":
|
||||||
|
autoComplete.onRightArrow(event); break;
|
||||||
case "Tab":
|
case "Tab":
|
||||||
autoComplete.onTab(event); break;
|
autoComplete.onTab(event); break;
|
||||||
case "Escape":
|
case "Escape":
|
||||||
|
|||||||
@@ -55,6 +55,22 @@ export default class AutocompleteWrapperModel {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onUpArrow() {
|
||||||
|
this._getAutocompleterComponent().moveSelection(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
onDownArrow() {
|
||||||
|
this._getAutocompleterComponent().moveSelection(+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
onLeftArrow() {
|
||||||
|
this._getAutocompleterComponent().moveSelection(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
onRightArrow() {
|
||||||
|
this._getAutocompleterComponent().moveSelection(+1);
|
||||||
|
}
|
||||||
|
|
||||||
onPartUpdate(part, offset) {
|
onPartUpdate(part, offset) {
|
||||||
// cache the typed value and caret here
|
// cache the typed value and caret here
|
||||||
// so we can restore it in onComponentSelectionChange when the value is undefined (meaning it should be the typed text)
|
// so we can restore it in onComponentSelectionChange when the value is undefined (meaning it should be the typed text)
|
||||||
|
|||||||
Reference in New Issue
Block a user