Hello, I'm migrating my embedded dashboards from I...
# gooddata-ui
m
Hello, I'm migrating my embedded dashboards from Iframes to React. One problem I'm struggling with is the React version is not full width (but the iframe is), and I'm not sure how to fix that? Is there a prop I'm missing? I've included the React vs. Iframe images below for clarify what I mean:
j
Hi Michael, Can you please confirm which SDK version are you using here?
m
10.4
Copy code
"@gooddata/api-client-tiger": "^10.4.0",
    "@gooddata/sdk-backend-tiger": "^10.4.0",
    "@gooddata/sdk-model": "^10.4.0",
    "@gooddata/sdk-ui-charts": "^10.4.0",
    "@gooddata/sdk-ui-dashboard": "^10.4.0",
    "@gooddata/sdk-ui-ext": "^10.4.0",
    "@gooddata/sdk-ui-geo": "^10.4.0",
    "@gooddata/sdk-ui-pivot": "^10.4.0",
d
Hello Michael, May I know if there’s any styling? You can check with dev tools > Elements which ones are being applied. Or in the App itself (usually under index file)
m
Hey Daniela, yes, here is the styling for the "gd-dashboards-root" class. Width is being set, but I'm not sure where from.
It's 2nd ancestor has a bigger width set:
The component-root class (immediate ancestor) has the width set:
d
From the screenshot, seems like
gd-flex-container
width is being limited from somewhere 🤔 Would it be possible to create a very very basic page to eliminate where the problem might be? for example, setting up something like this:
Copy code
export const App: React.FC = () => {
    return (
        <BackendProvider backend={backend}>
            <WorkspaceProvider workspace={workspaceId}>
                <div className="app">
                    <b>sup</b>
                    <Dashboard dashboard={dashboard} />
                </div>
            </WorkspaceProvider>
        </BackendProvider>
    );
};
Since I’m not familiarize with your code, I can try to guide you, but pls keep in mind that you might have to search in the app styling a bit further.
m
If I set component-root's width to 100%, everything looks correct.... I'll just do that. Weird I have to set it explicitly, though?
r
Heyo Michael, it is weird for sure 🙂 But then again, I tried to reproduce this on my own from more or less a fresh start, and the Dashboard seemed to inherit its width perfectly fine, so this is an interesting issue to begin with.
👍 1