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

Support for enum controls #199

Open
eAi opened this issue Mar 9, 2023 · 1 comment
Open

Support for enum controls #199

eAi opened this issue Mar 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@eAi
Copy link

eAi commented Mar 9, 2023

Describe the bug

I don't seem to be able to make enum/dropdown controls. I've tried setting the control to a table, but this doesn't work.

Expected behavior

I'd like to be able to set up a dropdown list of options for a prop.

Steps to reproduce

Using typescript:

const controls = {
	state: [State.A, State.B, State.C],
};
export = {
	summary: "A generic button component that can be used anywhere",
	roact: Roact,
	controls: controls,
	story: (props: { controls: typeof controls }) => {
		return (
			<Whatever
				matchmakingState={props.controls.state}
			/>
		);
	},
};

This syntax can't really work, but from looking at the code it seems as though something like this is supported, but nothing is documented for this.
@eAi eAi added the bug Something isn't working label Mar 9, 2023
@vocksel
Copy link
Collaborator

vocksel commented Mar 11, 2023

Enums should work for this. What does the generated lua code look like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants