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

[Bug]: CanvasPointerField disappears in Repeater #5

Open
ast21 opened this issue Sep 9, 2024 · 3 comments
Open

[Bug]: CanvasPointerField disappears in Repeater #5

ast21 opened this issue Sep 9, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ast21
Copy link

ast21 commented Sep 9, 2024

What happened?

Hi,

now I am implementing the creation of a field inside the Repeater layout, and when creating a new Repeater item, the field appears in the newly created one, and disappears in the previous items. Do you have any ideas how to implement working with the Repeater layout?

How to reproduce the bug

When I add a CanvasPointerField inside the Repeater and click AddItemButton, the CanvasPointerField in the previous Repeater item disappears

2024-09-09.15.00.12.mov
Forms\Components\Repeater::make('body')
    ->columnSpanFull()
    ->schema([
        CanvasPointerField::make('points')
            ->pointRadius(15) // default is 5
            ->imageUrl('https://avatars.githubusercontent.com/u/97165289')
            ->width(200) // required
            ->height(200) // required
            ->label('Select body parts that are in pain')
            ->columnSpanFull(),
    ]),

Package Version

1.0.3

PHP Version

8.3

Laravel Version

11

Which operating systems does with happen with?

macOS, Windows, Linux

Notes

No response

@ast21 ast21 added the bug Something isn't working label Sep 9, 2024
@erdalqc
Copy link

erdalqc commented Oct 2, 2024

We are having problems recording the marked locations to the database. Can you provide information about this issue?

@HungryBus
Copy link
Contributor

Actually, disappears in almost all dynamic elements that are not visible when the page is loaded. Same issue with Form Steps: if CanvasPointerField is NOT in the first step that's visible on page load, it won't be visible at all

@HungryBus
Copy link
Contributor

HungryBus commented Oct 13, 2024

This is due to the Livewire updates and re-rendersthe DOM element that canvas is attached to. Please see my PR for details:
#6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants