Devographics / Monorepo

Monorepo containing the State of JS apps
surveyform-sigma.vercel.app
Other
125 stars 51 forks source link

Error when I add more than 9 items to a list #347

Closed remnantkevin closed 9 months ago

remnantkevin commented 9 months ago

In the State of JS 2023 survey, in the Resources step, if I add more than 9 items to any of the lists, for example for podcasts, then I get the following error on the web page:

Could not load question podcasts (m[0] is undefined)

In the console the error is:

TypeError: m[0] is undefined
    tx TextList.tsx:343

If I click on the file name, I am taken to this part of the file:

  const selectFirstVirtualItem = useCallback(
    () => selectItem(wrapperRef.current, virtualItems[0].key),
    [virtualItems[0].key] // line 343
  );
SachaG commented 9 months ago

cc @eric-burel

eric-burel commented 9 months ago

@SachaG 10 is the default limit I think, it shouldn't crash though but I'll check we may increase the default limit in the meantime

eric-burel commented 9 months ago

Thanks @remnantkevin for figuring this out! @SachaG now the limit is actually enforced without bugs so we might want to display it, though I think users intuitively get that after ten they stop having new inputs so they reached a limit