Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web_src/js/components/DashboardRepoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export default defineComponent({
},

async reposFilterKeyControl(e: KeyboardEvent) {
if (e.isComposing) return;
switch (e.key) {
case 'Enter':
document.querySelector<HTMLAnchorElement>('.repo-owner-name-list li.active a')?.click();
Expand Down
1 change: 1 addition & 0 deletions web_src/js/components/RepoBranchTagSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export default defineComponent({
return el?.length ? el[0] : null;
},
keydown(e: KeyboardEvent) {
if (e.isComposing) return;
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
e.preventDefault();

Expand Down
2 changes: 2 additions & 0 deletions web_src/js/components/RepoFileSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const handleSearchInput = () => {
};

const handleKeyDown = (e: KeyboardEvent) => {
if (e.isComposing) return;

if (e.key === 'Escape') {
e.preventDefault();
clearSearch();
Expand Down
1 change: 1 addition & 0 deletions web_src/js/features/common-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function initGlobalFormDirtyLeaveConfirm() {

export function initGlobalEnterQuickSubmit() {
document.addEventListener('keydown', (e) => {
if (e.isComposing) return;
if (e.key !== 'Enter') return;
const hasCtrlOrMeta = ((e.ctrlKey || e.metaKey) && !e.altKey);
if (hasCtrlOrMeta && (e.target as HTMLElement).matches('textarea')) {
Expand Down
1 change: 1 addition & 0 deletions web_src/js/features/comp/EditorMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ function isTextExpanderShown(textarea: HTMLElement): boolean {

export function initTextareaMarkdown(textarea: HTMLTextAreaElement) {
textarea.addEventListener('keydown', (e) => {
if (e.isComposing) return;
if (isTextExpanderShown(textarea)) return;
if (e.key === 'Tab' && !e.ctrlKey && !e.metaKey && !e.altKey) {
// use Tab/Shift-Tab to indent/unindent the selected lines
Expand Down
1 change: 1 addition & 0 deletions web_src/js/features/repo-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function initRepoIssueLabelFilter(elDropdown: HTMLElement) {
});
// alt(or option) + enter to exclude selected label
elDropdown.addEventListener('keydown', (e: KeyboardEvent) => {
if (e.isComposing) return;
if (e.altKey && e.key === 'Enter') {
const selectedItem = elDropdown.querySelector('.label-filter-query-item.selected');
if (selectedItem) excludeLabel(e, selectedItem);
Expand Down
1 change: 1 addition & 0 deletions web_src/js/modules/fomantic/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ function attachDomEvents(dropdown: HTMLElement, focusable: HTMLElement, menu: HT
};

dropdown.addEventListener('keydown', (e: KeyboardEvent) => {
if (e.isComposing) return;
// here it must use keydown event before dropdown's keyup handler, otherwise there is no Enter event in our keyup handler
if (e.key === 'Enter') {
const elItem = menu.querySelector<HTMLElement>(':scope > .item.selected, .menu > .item.selected');
Expand Down
1 change: 1 addition & 0 deletions web_src/js/webcomponents/overflow-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ window.customElements.define('overflow-menu', class extends HTMLElement {
const div = document.createElement('div');
div.tabIndex = -1; // for initial focus, programmatic focus only
div.addEventListener('keydown', (e) => {
if (e.isComposing) return;
if (e.key === 'Tab') {
const items = this.tippyContent.querySelectorAll<HTMLElement>('[role="menuitem"]');
if (e.shiftKey) {
Expand Down