Skip to content
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

[Feature] Ability to set container element after Univer creation #4230

Open
2 tasks done
dima-jabali opened this issue Dec 4, 2024 · 0 comments
Open
2 tasks done
Labels
feature request New feature or request

Comments

@dima-jabali
Copy link

Initial checklist

  • Is this really a problem?
  • I have searched the Github Issues for similar issues, but did not find anything.

Problem

On the newest version of Univer (^0.5), the spreadsheet does not appear if the html container does not yet exist at the time of Univer's creation. I come from an earlier version of Univer where this wasn't a problem. But I need to update to latest univer and I can't find a solution to a problem without major refactor across several files 🫠.
At previous version, the spreadsheet appeared if the container were created a little bit after Univer's creation, but now it just never appears.

More context:
I setup the Redi context on a higher level in my provider tree:

return (
		<UniverApiContext.Provider value={store}>
			<RediContext.Provider value={store.injector}>
				{children}

				<SetExtraHelperFunctions />
			</RediContext.Provider>
		</UniverApiContext.Provider>
	);

and a few components down the tree call useDependency, that's why the Redi context is needed (custom UI). But the div container for the spreadsheet only appears down on that tree, so it does not yet exist when making the univer instance with const { univerAPI } = createUniver({ locale: LocaleType.EN_US, locales: { enUS: Tools.deepMerge( {}, UniverPresetSheetsCoreEnUS, ), }, theme: defaultTheme, presets: [ UniverSheetsCorePreset(), ], }); even though the spreadsheet is only created after the div is available (univerAPI.createUniverSheet({ name: 'Test Sheet' });).

@dima-jabali dima-jabali added the feature request New feature or request label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant