feat: multiple UX improvements to labels (#7358)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { isEscape } from '../helpers/KeyboardHelpers';
|
||||
import { isActiveElementTypeable, isEscape } from '../helpers/KeyboardHelpers';
|
||||
|
||||
export default {
|
||||
mounted() {
|
||||
@@ -9,13 +9,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
onKeyDownHandler(e) {
|
||||
const isEventFromAnInputBox =
|
||||
e.target?.tagName === 'INPUT' || e.target?.tagName === 'TEXTAREA';
|
||||
const isEventFromProseMirror = e.target?.className?.includes(
|
||||
'ProseMirror'
|
||||
);
|
||||
const isTypeable = isActiveElementTypeable(e);
|
||||
|
||||
if (isEventFromAnInputBox || isEventFromProseMirror) {
|
||||
if (isTypeable) {
|
||||
if (isEscape(e)) {
|
||||
e.target.blur();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user