Comments (3)
Thank you for the bug report! What is the best and easiest way to reproduce the problem?
from gooey.
Here is my basic setup:
local list = gooey.dynamic_list(list_id, list_stencil, list_item_template, items)
for i,item in ipairs(list.items) do
if item.data then
-- populate my gui nodes with data from item.data
end
end
If items
has anything in it during one call to this, then later items
has everything removed from it, then you will still get into the inner if
statement, but with stale data that used to be, but is no longer, in the items
list.
The gui does get disabled in this case, so the stale data isn't actually visible. However, the inner check does happen, so I need to actually detect that the data is stale (and not do anything that might crash).
The only reason I even noticed this was because I had a list of guid keys that I was using, and I was populating the gui based on data retrieved from a separate system keyed off those guids. The data retrieval returned nil
(because the data had been removed), I tried to pass nil
to a gui.set_text()
call, and it crashed. I eventually traced it back to gooey
giving me the stale data despite that data NOT being in the items
list I passed.
I worked around it by doing this:
if #items == 0 then
-- Bug in gooey if no items - it was keeping the item.data property around but invalid
-- https://github.com/britzl/gooey/issues/59
for i=1,#list.items do
list.items[i].data = nil
end
end
However, after submitting this bug, I found this ALSO happens when items are removed from an overly full list - I had like 10 things in my list, and I deleted a few, and during one of these deletions I once again hit a case where items.data
was stale. I suspect the overall list could hold N
items, and when dropping down to N-1
pieces of data, I started to get stale data that wasn't in the array passed.
from gooey.
Thanks, I'll look into it during the week.
from gooey.
Related Issues (20)
- Don't click on a list item if the list have been scrolled HOT 1
- input component doesn't handle utf8 characters HOT 1
- Allow to configure scroll behavior for horizontal lists
- Trying to erase none utf8 characters throw errors HOT 4
- Input state machine doesn't include 'released_now' or 'clickable' fields on last frame HOT 13
- Scroll list flick
- Using character . after numbers will introduces extra characters on mobile HOT 6
- Missing return checkbox instance in set_checked or set_visible HOT 1
- Scrolling wheel speed option
- How can I change the theme ? HOT 2
- No typing input from Android browsers HOT 2
- Missed backspaces on iOS
- Grid component
- .nodes failing on list items in dynamic_list HOT 3
- Input widget's "deselected_now" property always false
- List data HOT 1
- Lists are not updated on list refresh since 10.0.0 HOT 2
- Fix for trailing spaces creates issues
- Dynamic List Refresh Behavior HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gooey.