Open kexul opened 8 months ago
import gradio as gr
js = '''
function disablePropagation(){
var textarea = document.querySelector('textarea[data-testid="textbox"]');
if (textarea) {
textarea.addEventListener('keydown', function(event) {
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
event.stopPropagation();
}
});
}
}
'''
with gr.Blocks(js=js) as app:
audio = gr.Audio('https://github.com/gradio-app/gradio/raw/main/test/test_files/audio_sample.wav', label='Test')
text = gr.Textbox()
app.launch()
Here is the solution provided by chatgpt, works very well for my case, hopefully it helps others meet the same problem.
Reopening as this is a bug we should fix.
Hi, apologies for the late follow up. We haven't had a chance to look into this issue, but the Gradio codebase has changed quite significantly since this issue was created, particularly with the release of Gradio 5. Could you let us know if this is still an issue in the latest version of Gradio (pip install --upgrade gradio
)? Thanks!
@abidlabs Yes, It's still an issue.
Describe the bug
When I move the cursor in the textbox by pressing left and right arrow key, the starting position of the audio timeline is moved.
Have you searched existing issues? š
Reproduction
Screenshot
Logs
No response
System Info
Severity
I can work around it