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]: If I want to select multiple values, each time I need to click the select. The nodes closing immediately after each item selected #119

Open
CWSPS154 opened this issue Aug 1, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@CWSPS154
Copy link

CWSPS154 commented Aug 1, 2024

What happened?

Attaching the video
Screencast from 01-08-24 12:26:03 PM IST.webm

How to reproduce the bug

SelectTree::make('permission_id') ->label('Permissions') ->live() ->relationship('permissions', 'name','parent_id', function ($query) { return $query->where('status', true); },function ($query) { return $query->where('status', true); }) ->searchable() ->columnSpanFull()

Package Version

3.1.42

PHP Version

8.2

Laravel Version

11.18.1

Which operating systems does with happen with?

Linux

Notes

No response

@CWSPS154 CWSPS154 added the bug Something isn't working label Aug 1, 2024
@CWSPS154
Copy link
Author

Any update on this issue? @CodeWithDennis

@CodeWithDennis
Copy link
Owner

That should only happen with single select fields. Can you share your code and maybe a short video?

@CWSPS154
Copy link
Author

CWSPS154 commented Aug 25, 2024

Thank You for response,
Actually I am using multi select, only.Could please check this video Video

@CodeWithDennis
Copy link
Owner

Thanks, that's definitely strange... does the behavior stop when you remove live()?

@CWSPS154
Copy link
Author

Without the live(), its working as expected

@CWSPS154
Copy link
Author

CWSPS154 commented Aug 25, 2024

@CodeWithDennis
SelectTree::make('permission_id')
->label(__('filament-users-roles-permissions::users-roles-permissions.role.resource.form.permissions'))
->relationship('permissions', 'name', 'parent_id', function ($query) {
return $query->where('status', true);
}, function ($query) {
return $query->where('status', true);
})
->afterStateUpdated(function (Get $get, $state, Forms\Set $set) {
if ($get('all_permission')) {
$set('all_permission', !$state);
}
})
->searchable()
->columnSpanFull()
I need to implements this, but without live(), its not work

@CodeWithDennis
Copy link
Owner

@CodeWithDennis

SelectTree::make('permission_id')

                ->label(__('filament-users-roles-permissions::users-roles-permissions.role.resource.form.permissions'))

                ->relationship('permissions', 'name', 'parent_id', function ($query) {

                    return $query->where('status', true);

                }, function ($query) {

                    return $query->where('status', true);

                })

                ->afterStateUpdated(function (Get $get, $state, Forms\Set $set) {

                    if ($get('all_permission')) {

                        $set('all_permission', !$state);

                    }

                })

                ->searchable()

                ->columnSpanFull()

I need to implements this, but without live(), its not work

I figured, i wont have time since im leaving for holiday soon but if you want to take a crack at it i would appreciate it

@CodeWithDennis
Copy link
Owner

Looking back at this, it seems the issue is caused because the field is being rendered live, which is what's closing it.

@CWSPS154
Copy link
Author

@CodeWithDennis , Thank you. But I need to implement this with live(), because this field is dependence on some other columns

@CodeWithDennis
Copy link
Owner

I understand. I’m not sure if I can fix that right now, but one thing you could try is using ->live(onBlur: true). Let me know if that helps.

@CWSPS154
Copy link
Author

I already tried this, but it's not worked

@DevYSM
Copy link

DevYSM commented Nov 4, 2024

The same issue with me.
Do you have any updates?

note: I'm using it in the table filters.

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