mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-22 17:25:08 +01:00
enhance(client): Improve emoji autocomplete behaviour
cherry picked from 4b2c215e25
This commit is contained in:
parent
bb2db1cf76
commit
04855f9201
2 changed files with 4 additions and 3 deletions
|
@ -10,9 +10,10 @@
|
||||||
## 12.x.x (unreleased)
|
## 12.x.x (unreleased)
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
- 依存関係の更新
|
- 絵文字オートコンプリートの挙動を改修
|
||||||
- localStorageのaccountsはindexedDBで保持するように
|
- localStorageのaccountsはindexedDBで保持するように
|
||||||
- ActivityPub: ジョブキューの試行タイミングを調整 (#7635)
|
- ActivityPub: ジョブキューの試行タイミングを調整 (#7635)
|
||||||
|
- 依存関係の更新
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
- チャンネルを作成しているとアカウントを削除できないのを修正
|
- チャンネルを作成しているとアカウントを削除できないのを修正
|
||||||
|
|
|
@ -65,7 +65,7 @@ export class Autocomplete {
|
||||||
*/
|
*/
|
||||||
private onInput() {
|
private onInput() {
|
||||||
const caretPos = this.textarea.selectionStart;
|
const caretPos = this.textarea.selectionStart;
|
||||||
const text = this.text.substr(0, caretPos).split('\n').pop();
|
const text = this.text.substr(0, caretPos).split('\n').pop()!;
|
||||||
|
|
||||||
const mentionIndex = text.lastIndexOf('@');
|
const mentionIndex = text.lastIndexOf('@');
|
||||||
const hashtagIndex = text.lastIndexOf('#');
|
const hashtagIndex = text.lastIndexOf('#');
|
||||||
|
@ -83,7 +83,7 @@ export class Autocomplete {
|
||||||
|
|
||||||
const isMention = mentionIndex != -1;
|
const isMention = mentionIndex != -1;
|
||||||
const isHashtag = hashtagIndex != -1;
|
const isHashtag = hashtagIndex != -1;
|
||||||
const isEmoji = emojiIndex != -1;
|
const isEmoji = emojiIndex != -1 && text.split(/:[a-z0-9_+\-]+:/).pop()!.includes(':');
|
||||||
|
|
||||||
let opened = false;
|
let opened = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue