-
Notifications
You must be signed in to change notification settings - Fork 83
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
Cannot assign readonly items to Grid and ComboBox #8327
Comments
This should be addressed in the web components so I transferred the issue here. Note, in the past there used to be a plan to make all data structures readonly but it was then discarded. IMO this would be a breaking change since it's currently possible to use something like
We should investigate if there might be some other implications of using readonly items. |
In case it is useful, the context in which I ran into this problem was when I tried to use a full-stack signal as an items source for a grid and a combo box. That was not possible because the |
Maybe we could do this to avoid breaking changes: get items(): TItem[] | null | undefined;
set items(value: TItem[] | readonly TItem[] | null | undefined); |
This also might affect other properties apart from the |
It is currently not possible to assign a readonly array as items to a
Grid
or aComboBox
(or possibly the other selection components as well; I haven't tried). The following code:Gives the following error:
If I remove
readonly
, it works. Since the selection components are not editing their own items, I think it should not matter whether the array I pass in isreadonly
or not.The text was updated successfully, but these errors were encountered: