mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
de573407cb65e334d7df7411d1296660aa7e0dcf
This fixes a crash caused by react-dropzone due to the fact that button
elements aren't compatible with whatever react-dropzone is looking for.
TypeError: rootRef.current.isEqualNode is not a function
(anonymous function)
node_modules/react-dropzone/dist/es/index.js:473
470 |
471 | var onKeyDownCb = useCallback(function (event) {
472 | // Ignore keyboard events bubbling up the DOM tree
> 473 | if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {
| ^ 474 | return;
475 | }
476 |
Wrapping it in a div element solves the problem.
Also disable tabIndex on the dropzone to prevent the button from being
focused twice when tabbing through the buttons.
pybricks-code
A Web App for programming LEGO® Powered Up smart hubs using Pybricks MicroPython.
Try it at https://code.pybricks.com.
LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this project
Contributing
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
For more details, see the file CONTRIBUTING.md.
Languages
TypeScript
90%
JavaScript
7.6%
SCSS
2.1%
HTML
0.2%
Python
0.1%
