mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Add down key check has tribute container (#21016)
Fixes an issue where users would not be able to select by pressing the down arrow when using @TAG above a message Bug videos: https://user-images.githubusercontent.com/1255041/188095999-c4ccde18-e53b-4251-8a14-d90c4042d768.mp4
This commit is contained in:
		@@ -92,6 +92,18 @@ export async function createCommentEasyMDE(textarea, easyMDEOptions = {}) {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      cm.execCommand('delCharBefore');
 | 
					      cm.execCommand('delCharBefore');
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    Up: (cm) => {
 | 
				
			||||||
 | 
					      const tributeContainer = document.querySelector('.tribute-container');
 | 
				
			||||||
 | 
					      if (!tributeContainer || tributeContainer.style.display === 'none') {
 | 
				
			||||||
 | 
					        return cm.execCommand('goLineUp');
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    Down: (cm) => {
 | 
				
			||||||
 | 
					      const tributeContainer = document.querySelector('.tribute-container');
 | 
				
			||||||
 | 
					      if (!tributeContainer || tributeContainer.style.display === 'none') {
 | 
				
			||||||
 | 
					        return cm.execCommand('goLineDown');
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
  await attachTribute(inputField, {mentions: true, emoji: true});
 | 
					  await attachTribute(inputField, {mentions: true, emoji: true});
 | 
				
			||||||
  attachEasyMDEToElements(easyMDE);
 | 
					  attachEasyMDEToElements(easyMDE);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user