mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2025-11-04 14:41:57 +00:00 
			
		
		
		
	feat: make CreatePlaylistModal handle Enter key
This commit is contained in:
		@@ -24,7 +24,19 @@ export default {
 | 
			
		||||
            playlistName: "",
 | 
			
		||||
        };
 | 
			
		||||
    },
 | 
			
		||||
    mounted() {
 | 
			
		||||
        window.addEventListener("keydown", this.handleKeyDown);
 | 
			
		||||
    },
 | 
			
		||||
    unmounted() {
 | 
			
		||||
        window.removeEventListener("keydown", this.handleKeyDown);
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
        handleKeyDown(event) {
 | 
			
		||||
            if (event.code === "Enter") {
 | 
			
		||||
                this.onCreatePlaylist();
 | 
			
		||||
                event.preventDefault();
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        onCreatePlaylist() {
 | 
			
		||||
            if (!this.playlistName) return;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -65,7 +65,7 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
        handleKeyDown(event) {
 | 
			
		||||
            if (event.code === "Enter") {
 | 
			
		||||
            if (event.code === "Enter" && !this.showCreatePlaylistModal) {
 | 
			
		||||
                this.handleClick(this.selectedPlaylist);
 | 
			
		||||
                event.preventDefault();
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user