Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

region.setOptions({..}) does not modify the region's color #3879

Open
omerman opened this issue Sep 23, 2024 · 9 comments
Open

region.setOptions({..}) does not modify the region's color #3879

omerman opened this issue Sep 23, 2024 · 9 comments
Assignees
Labels

Comments

@omerman
Copy link

omerman commented Sep 23, 2024

Bug description

region.setOptions({..}) does not modify the region's color.

Environment

  • Browser: Chrome

Minimal code snippet

Will provide minimal code snippet in the upcoming days, but incase you have a minimal repo of your own to work with, I thought I'd give you a head start

Expected result

region.setOptions({..}) should be able to update the region's color.

Obtained result

Screenshots

@omerman omerman added the bug label Sep 23, 2024
@lucastheis
Copy link
Contributor

Regarding clearRegions(), see issue #3798.

@katspaugh
Copy link
Owner

Closing as a duplicate of #3798.

@katspaugh katspaugh closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2024
@omerman
Copy link
Author

omerman commented Sep 26, 2024

@katspaugh But the setOptions part is not duplicate, will this also be addressed? 😢

@katspaugh katspaugh reopened this Sep 26, 2024
@katspaugh katspaugh changed the title RegionsPlugin has some core issues, Help? region.setOptions({..}) does not modify the region's color Sep 26, 2024
@katspaugh
Copy link
Owner

@omerman thanks for the sponsorship! I’ll prioritize this and the other regions issue. 👍

@katspaugh katspaugh self-assigned this Sep 26, 2024
@omerman
Copy link
Author

omerman commented Sep 26, 2024

@katspaugh Thank you so much for your work 🙏

@JanMisker
Copy link
Contributor

@omerman I had noticed something similar, it turns out that some of my regions were initially of zero-width implying they were internally marked as markers. And markers don't have a background color. Even after the regions were being extended to actual markers, they were still not picking up the color.

@omerman
Copy link
Author

omerman commented Oct 1, 2024

@JanMisker Im passing only the start arg, so I guess by default it is also used as a marker
here is my code snippet:

regionsPlugin.addRegion({
          id: `tempo_${i}`,
          start: tempoItem,
          color: i === playerIndex ? colors.pink['500'] : colors.gray['400'], // init
          drag: false,
          resize: false,
        });

And because a color cannot be updated I have to remove the region and recreate it 😅

@JanMisker
Copy link
Contributor

@omerman yeah that will be it; because you give no value for end, it is a marker and doesn't get a color.

@omerman
Copy link
Author

omerman commented Oct 9, 2024

@omerman yeah that will be it; because you give no value for end, it is a marker and doesn't get a color.

@JanMisker
Just to make sure we are both on the same page,
My regions have colors, but the update options method won't work when I try to update the color. I need to remove them and re-create them in order to make a color update
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants