Open colbyfayock opened 4 weeks ago
Hey, I think I might have come with a workaround for this, which is basically:
{typeof children === "function" && children({ cloudinary: cloudinary.current, widget: widget.current, results, error, isLoading: isScriptLoading, ...instanceMethods, })}
First I commented this out. In my particular code it wasn't necessary and the only use would be the open function, but it kept saying that open was undefined. I'm aware this is important to many but I don't know how I could make this work.
function createWidget() { return cloudinary.current?.createUploadWidget(uploadOptions, resultsCallback); }
Changing createUploadWidget
to openUploadWidget
, so it creates the widget and open it automatically.
And finally I used the inlineContainer as usual, but only "#container-id" worked. When using the document.getElementById method, it made the Widget popup in a modal.
I know this is not ideal, I would like to contribute but I'm sure how it should be done.
i would suggest checking for the existence of inlineContainer
and handling it differently depending on that
further, an alternative approach, is to add an inline
prop, which instead of forcing someone to manually define these values, could return an element somewhere which would act as the inline container
we would then set the inlineContainer
ourselves and change any logic to open the widget based on that nested location
does that make sense?
Discussed in https://github.com/cloudinary-community/next-cloudinary/discussions/560