Extending a Button with FileDownloader causes any keyboard shortcut added with setClickShortut to not work
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
Found using Chrome, Vaadin 8.4.3, Wildfly 10.1
To reproduce create a Button and add a keyboard shortcut using something like:
Button btnDownload = new Button(VaadinIcons.DOWNLOAD, event -> System.out.println("download"));
btnDownload.setClickShortcut(KeyCode.P, ModifierKey.CTRL);
The button (if you added a click listener) is triggered when you click it or press Ctrl-P.
Then take out the click handler and extend with FileDownloader:
Button btnDownload = new Button(VaadinIcons.DOWNLOAD);
btnDownload.setClickShortcut(KeyCode.P, ModifierKey.CTRL);
StreamResource downloadResource = getDownloadResource();
FileDownloader fileDownloader = new FileDownloader(downloadResource);
fileDownloader.extend(btnDownload);
The download works if you click the button, but it no longer works if you press Ctrl-P.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Button keyboard-shortcut path and the FileDownloader.extend(btnDownload) path described in the reproduction. Verify the behavior with the provided Ctrl-P examples; done means a button extended with FileDownloader still triggers its download when the configured keyboard shortcut is pressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100