Replies: 2 comments
-
Thank you for using Tweakpane. Currently there is no way to change options other than recreating it with new options. Ref: #63 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Released the latest version 3.1.2 and added a way to change list options: JavaScript: ...
const i1 = pane.addInput(PARAMS, 'prop', {
options: [
{ text: 'foo', value: 0 },
{ text: 'bar', value: 1 },
],
});
const value = i1.controller_.binding.value;
const constraint = value.constraint.constraints[0];
constraint.values.set('options', [
{ text: 'baz', value: 2 },
{ text: 'qux', value: 3 },
]); TypeScript: import { ListConstraint } from '@tweakpane/core';
...
const i1 = pane.addInput(PARAMS, 'prop', {
options: [
{ text: 'foo', value: 0 },
{ text: 'bar', value: 1 },
],
});
const value = i1.controller_.binding.value;
const constraint = (value as any).constraint.constraints[0] as ListConstraint;
constraint.values.set('options', [
{ text: 'baz', value: 2 },
{ text: 'qux', value: 3 },
]); Note that it's unstable and not supported because it uses a private field. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I created an input item with some options.
Are there any way to change the options of input panel?
Beta Was this translation helpful? Give feedback.
All reactions