-
Notifications
You must be signed in to change notification settings - Fork 333
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
Lua Element:GetElementsByTagName result is 0-indexed #237
Comments
Thanks for reporting! Indeed, I'd prefer this to be 1-indexed in Lua indeed. See also this related discussion: #137 Are you able to make a PR for this one? |
I looked through the Lua API reference and these are the properties/functions I found that could be affected by indexing:
I didn't check the DataGrid stuff. Just didn't want to learn it and set it up and it's deprecated anyway. I couldn't get the index parameter of these functions to work at all, they just added to the end, whatever the value:
Of the rest of them, these are 0-indexed:
I see another problem if ElementTabSet.active_tab is changed to be 1-indexed: tabchange events include it as a parameter. This might affect ElementFormControlSelect as well. |
That's a very detailed list, good work! I think it's okay to leave out the datagrid things with them being deprecated, they can have the old behavior. A PR to change the indexing would be very much welcome, and perhaps (a separate?) one for fixing ElementTabSet:SetPanel and ElementTabSet:SetTab. I'll leave to your decision whether or not to change the indexing of ElementTabSet and/or change the |
Reproducing:
Expected result (in console):
Actual result (in console):
Obviously this could be breaking for someone if fixed but the inconsistency with child_nodes (as well as being 0-indexed in Lua) isn't great either.
The text was updated successfully, but these errors were encountered: