You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The currency format isn't applied until we edit the value.
Expected behavior
The cell appearing as $69,420.00 instead of 69420 immediately.
Additional context
LuckySheet actually was applying formats on initialization. I'm porting LuckyExcel, which didn't generate the m pre-cached text values itself (and it'd be annoying to generate them since the formatter isn't actually exposed in the API), and it worked fine on the original version.
As an ugly workaround I'm currently using setCellFormat with the existing formats everywhere:
<Workbookkey={key}ref={sheetRef}data={sheets}style={{flex: '1'}}onChange={()=>{// This handler is run when the sheets themselves change, *not* any piece of data inside them.for(constsheetofsheetRef.current.getAllSheets()){if(!sheet.data)continue;for(letr=0;r<sheet.data.length;r++)for(letc=0;c<sheet.data[r].length;c++)if(typeofsheet.data[r][c]?.ct==='object'&&sheet.data[r][c].ct.t!=='s')sheetRef.current.setCellFormat(r,c,'ct',sheet.data[r][c].ct,{id: sheet.id});}}}/>
The text was updated successfully, but these errors were encountered:
I believe that this issue closely mirrors #499, which is essentially the sheet needing manually calculated values of cells containing any types of formulae - since it updates the cells only upon editing something.
I have been using a hack to make the sheet set values programatically as a workaround, but it quickly runs into issues at scale. I believe the way to solve all of these issues without much effort would be to call jfrefreshgrid after the sheet is done loading for the first time.
Describe the bug
When initializing the component with cells that only have a value and a desired format, but aren't pre-formatted, the raw value is displayed directly.
fortune-sheet/packages/core/src/modules/format.ts
Lines 317 to 319 in e2527a5
However it would make sense to generate and cache the
m
formatted value using the cell's format.To Reproduce
Initialize with e.g.
The currency format isn't applied until we edit the value.
Expected behavior
The cell appearing as
$69,420.00
instead of69420
immediately.Additional context
LuckySheet actually was applying formats on initialization. I'm porting LuckyExcel, which didn't generate the
m
pre-cached text values itself (and it'd be annoying to generate them since the formatter isn't actually exposed in the API), and it worked fine on the original version.As an ugly workaround I'm currently using
setCellFormat
with the existing formats everywhere:The text was updated successfully, but these errors were encountered: