Media controller hotkeys attribute fails on vue
clemator opened this issue · comments
Vue: 3.4.19
Media-chrome: 2.2.5
Observed behavior
When setting the hotkeys
attribute to the value noarrowleft noarrowright
we have a warning from vue and the hotkey is still working.
Expected behavior
No warning from Vue and the hotkeys are disabled
Steps:
Go to https://stackblitz.com/edit/vitejs-vite-zpbjww?file=src%2FApp.vue and open the console
You will see a warning from Vue.
Focus on the video by clicking it and press left or right arrow.
![Capture d’écran 2024-02-22 à 18 45 13](https://private-user-images.githubusercontent.com/6240835/307095581-0722ec16-4a02-4b38-8881-b552ddd789c5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzMjkyMTksIm5iZiI6MTcyMjMyODkxOSwicGF0aCI6Ii82MjQwODM1LzMwNzA5NTU4MS0wNzIyZWMxNi00YTAyLTRiMzgtODg4MS1iNTUyZGRkNzg5YzUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDczMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MzBUMDg0MTU5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2FhMzdmZWM4ODQ1NjE2NDY0NTBmNDUyMTQ4YzdmYTJkNGMwMjVjOTNjYjhiNWNmOTdkOTdhYjZmZTAxODdmOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.CkUetQRkHqvOZvMqIf7Q6c_AP8_VSeuuYkeOlU9EDGE)
Hey there @clemator unfortunately it looks like Vue gets confused when there's a read only property with the same name as a corresponding attribute, which is the case for hotkeys
. There may be a cleaner way to do this in Vue 3 (not my core area of expertise), but, as a workaround, you should be able to use a ref
+ onMounted
to explicitly set the attribute for your use case. See my modified version of your example code here:
https://stackblitz.com/edit/vitejs-vite-5wur6c?file=src%2FApp.vue
Let me know if that works out for you, and thanks for the feedback!
Hello @cjpillsbury, yes this works as a work around 👍 thank you for looking at it!