react-piano icon indicating copy to clipboard operation
react-piano copied to clipboard

How to sustain Active Notes on Mouse Over?

Open kyasuzuki opened this issue 5 years ago • 3 comments

Hi Kevin, Thank you so much for your contribution of react-piano. I am utilizing your package to display different piano chord shapes - when a user selects a chord shape (e.g. Major), I have set those notes in Active Notes (& in turn, Active Notes highlights the 3 keys on the piano that make C Major). This all functions correctly. However, if I move my mouse over any of the highlighted keys (active), they become unhighlighted (inactive). How can I change this property such that unless a new array of Active notes is provided, the keys remain highlighted & are unaffected by mouseover? Thank you!

kyasuzuki avatar Mar 12 '20 22:03 kyasuzuki

That's a cool idea and a feature I'd been thinking about - being able to render static non-interactive pianos. I think it would take a few changes to make that happen though.

(related to: https://github.com/kevinsqi/react-piano/issues/27)

kevinsqi avatar Mar 14 '20 19:03 kevinsqi

Also interested. Do I understand correctly code responsible for it is here? https://github.com/kevinsqi/react-piano/blob/5d6c62a068f1b01a663adfb7a4ad2e3dfa932847/src/Piano.js#L49-L52

ilionic avatar Jun 01 '20 22:06 ilionic

I posted a possible solution on: #27 https://github.com/kevinsqi/react-piano/issues/27#issuecomment-961423065

agualdron avatar Nov 05 '21 02:11 agualdron