mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	poll_widget: Use e.key instead of deprecated e.keyCode.
Tested by making sure Enter and Escape work for editing poll title and adding new poll options.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							c292ade96a
						
					
				
				
					commit
					121e21d3b9
				
			@@ -125,12 +125,12 @@ export function activate({
 | 
			
		||||
        elem.find("input.poll-question").on("keydown", (e) => {
 | 
			
		||||
            e.stopPropagation();
 | 
			
		||||
 | 
			
		||||
            if (e.keyCode === 13) {
 | 
			
		||||
            if (e.key === "Enter") {
 | 
			
		||||
                submit_question();
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (e.keyCode === 27) {
 | 
			
		||||
            if (e.key === "Escape") {
 | 
			
		||||
                abort_edit();
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
@@ -159,12 +159,12 @@ export function activate({
 | 
			
		||||
        elem.find("input.poll-option").on("keydown", (e) => {
 | 
			
		||||
            e.stopPropagation();
 | 
			
		||||
 | 
			
		||||
            if (e.keyCode === 13) {
 | 
			
		||||
            if (e.key === "Enter") {
 | 
			
		||||
                submit_option();
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (e.keyCode === 27) {
 | 
			
		||||
            if (e.key === "Escape") {
 | 
			
		||||
                $("input.poll-option").val("");
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user