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

ActionColumn onClick not working when using svg + path #8856

Closed
ghulamghousdev opened this issue Mar 21, 2024 · 0 comments
Closed

ActionColumn onClick not working when using svg + path #8856

ghulamghousdev opened this issue Mar 21, 2024 · 0 comments
Assignees
Labels
bug Something isn't working forum Issues from forum resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@ghulamghousdev
Copy link
Member

Forum post

Hi, I'm using the scheduler pro version 5.6.7.

I have action column and I'm using the onClick handler and renderer function.

I tested on the grouping demo and I modified the settings action to return a svg + path:

{
                renderer: () => {
                     return `<svg class="b-action-item b-tool" width="16" height="8" viewBox="0 -2 20 24" fill="none" xmlns="http://www.w3.org/2000/svg">
              <path d="M2.50008 2.5C2.03984 2.5 1.66675 2.8731 1.66675 3.33333V16.6667C1.66675 17.1269 2.03984 17.5 2.50008 17.5H5.00008C5.46032 17.5 5.83341 17.1269 5.83341 16.6667V3.33333C5.83341 2.8731 5.46032 2.5 5.00008 2.5H2.50008Z" fill="black" fill-opacity="1"/>
              <path d="M7.50008 3.33333C7.50008 2.8731 7.87318 2.5 8.33341 2.5H10.8334C11.2937 2.5 11.6667 2.8731 11.6667 3.33333V16.6667C11.6667 17.1269 11.2937 17.5 10.8334 17.5H8.33341C7.87318 17.5 7.50008 17.1269 7.50008 16.6667V3.33333Z" fill="black" fill-opacity="1"/>
              <path d="M13.3334 3.33333C13.3334 2.8731 13.7065 2.5 14.1667 2.5H16.6667C17.127 2.5 17.5001 2.8731 17.5001 3.33333V16.6667C17.5001 17.1269 17.127 17.5 16.6667 17.5H14.1667C13.7065 17.5 13.3334 17.1269 13.3334 16.6667V3.33333Z" fill="black" fill-opacity="1"/>
              </svg>
`
                },
                tooltip : 'Settings',
                onClick : ({ record }) => Toast.show('TODO: Show a cool settings dialog')
            },

Notice that If we click exactly on one of the bars, onClick is never triggered. But if you click between them or outside the icon (zoom the page to see this easier) the handler is called.

looks like the onClick only works for the parent, in this case if you click the element.

I do want to return the path on the renderer though, cause in the example I use fill="black" but on the app I want to use a css variable.

Is there a workaround for this?

Thanks!

@ghulamghousdev ghulamghousdev added bug Something isn't working forum Issues from forum labels Mar 21, 2024
@matsbryntse matsbryntse changed the title Action OnClick not working when using svg + path ActionColumn onClick not working when using svg + path Mar 23, 2024
@matsbryntse matsbryntse self-assigned this Mar 23, 2024
@matsbryntse matsbryntse added the ready for review Issue is fixed, the pull request is being reviewed label Mar 23, 2024
@isglass isglass added resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Mar 25, 2024
@isglass isglass added this to the 5.6.9 milestone Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

3 participants