Prerender Image Component field

I created a qr generator function.. is it possible to use partiallyRenderComponentsAfterStateUpdated to partially render the qr image but unfortunately, we cant select the Image Component..
ColorPicker::make('background_color')
->default('#ffffff')
->required()
->live()
->partiallyRenderComponentsAfterStateUpdated(['<it should select the image>']),
Image::make(
url: fn (Get $get) => static::getQrImage($get),
alt: 'QR code to scan',
)
->imageHeight(fn (Get $get) => $get('size') ?? 500)
->alignCenter(),
ColorPicker::make('background_color')
->default('#ffffff')
->required()
->live()
->partiallyRenderComponentsAfterStateUpdated(['<it should select the image>']),
Image::make(
url: fn (Get $get) => static::getQrImage($get),
alt: 'QR code to scan',
)
->imageHeight(fn (Get $get) => $get('size') ?? 500)
->alignCenter(),
4 Replies
Eskie
EskieOP4w ago
What I want to achieve is, I dont want to reset the behavior of the scrollbar when the component at the bottom changes
toeknee
toeknee4w ago
So set a default hieght on the container?
Image::make(
url: fn (Get $get) => static::getQrImage($get),
alt: 'QR code to scan',
)
->imageHeight(fn (Get $get) => $get('size') ?? 500)
->extraAttributes(['style' => 'min-height: 600px;'])
->alignCenter(),
Image::make(
url: fn (Get $get) => static::getQrImage($get),
alt: 'QR code to scan',
)
->imageHeight(fn (Get $get) => $get('size') ?? 500)
->extraAttributes(['style' => 'min-height: 600px;'])
->alignCenter(),
Eskie
EskieOP4w ago
actually my problem is that when I select a color on Eyes outer color it suddenly returns on the top page so i am thinking the reason behind it is because it refreshes the page but i am not sure so that is why i want to render the QR image only, i want to know if it will still returns to the top.
No description
toeknee
toeknee4w ago
It doesn't refresh the page, but if it is a live component it will refreshes everything in the form

Did you find this page helpful?