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

props.isHovered not working #7281

Closed
phpbits opened this issue Jun 12, 2018 · 17 comments
Closed

props.isHovered not working #7281

phpbits opened this issue Jun 12, 2018 · 17 comments
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Help Request Help with setup, implementation, or "How do I?" questions.

Comments

@phpbits
Copy link
Contributor

phpbits commented Jun 12, 2018

Hi,

I'm creating a tabbed-layout column for easier column management and found out that isSelected is working but isHovered isn't. Here's a preview on what I'm working on. Thanks!

screen capture on 2018-06-11 at 17-13-19

Cheers,
Jeffrey

@youknowriad
Copy link
Contributor

In which component isHovered is not working? Is it in a block? If that's the case, I think isHovered was never a thing there?

@youknowriad youknowriad added the [Status] Needs More Info Follow-up required in order to be actionable. label Jun 12, 2018
@phpbits
Copy link
Contributor Author

phpbits commented Jun 12, 2018

@youknowriad Hmmm, searched and there's isHovered on property. What do you recommend in order for me to display the tabs on inner block selection? I need to be able to display them aside from when the main column block is selected. Thanks!

@youknowriad
Copy link
Contributor

Maybe you should try showing them inside the edit function of your wrapper's block. But not as buttons in the BlockControls but directly inside the block itself.

@youknowriad youknowriad added the [Type] Help Request Help with setup, implementation, or "How do I?" questions. label Jun 12, 2018
@phpbits
Copy link
Contributor Author

phpbits commented Jun 12, 2018

@youknowriad I'm using blocks.BlockEdit filter via ES5, would you mind letting me know which is the edit function? I'm using similar function to this one : #4002 Thanks!

@youknowriad
Copy link
Contributor

youknowriad commented Jun 12, 2018

Oh, so you're extending the core provided columns block, I suggested creating your own columns block instead. Or if you prefer, you can add the tabs to your blocks.BlockEdit hook for the columns block.

@phpbits
Copy link
Contributor Author

phpbits commented Jun 12, 2018

@youknowriad yes. I think there's no point on creating a new one since I'll be adding toggle selection view on the block's setting area. Do you think it's possible to show the tabs when innerblocks are selected? Thanks!

@youknowriad
Copy link
Contributor

If the tabs are not displayed in BlockControls they will be always visible.

@phpbits
Copy link
Contributor Author

phpbits commented Jun 12, 2018

@youknowriad Thanks! Will try it out.

@youknowriad
Copy link
Contributor

I'm closing for now, let me know if it doesn't work.

@phpbits
Copy link
Contributor Author

phpbits commented Jun 12, 2018

@youknowriad I thinks there's no option aside from BlockControls. Do you have any suggestion? Thanks!

@youknowriad
Copy link
Contributor

Just remove the BlockControls wrapper. Can you share the code of your hook?

@phpbits
Copy link
Contributor Author

phpbits commented Jun 12, 2018

@youknowriad I'm using similar code to this one : #4002 👍

var testButton = !! props.focus
                && el(
                    BlockControls,
                    { key: 'test_button_block' },
                    el(
                        TestButton,
                        {
                            button: {
                                key: 'test_button',
                                isPrimary: false,
                                title: __( 'Test', 'test' ),
                                onClick: onTestButtonClick
                            },
                            container: {
                                className: 'components-toolbar'
                            },
                        }
                    )
                );
            element = [ element, testButton ];

@phpbits
Copy link
Contributor Author

phpbits commented Jun 12, 2018

@youknowriad Can you change the status to open again? Thanks!

@youknowriad
Copy link
Contributor

Remove the wrapper BlockControls and the props.focus test

@phpbits
Copy link
Contributor Author

phpbits commented Jun 12, 2018

@youknowriad Thanks! It's working now. Another question is do have idea how can I add item on the Block Settings? I need to add toggle view for tabbed and the default one. Thanks!
screen shot 2018-06-12 at 6 59 24 pm

@phpbits
Copy link
Contributor Author

phpbits commented Jun 12, 2018

@youknowriad There's a problem on onClick when it's not on BlockControls. Seems like click is disabled. Thanks!

@youknowriad
Copy link
Contributor

how can I add item on the Block Settings?

That's not possible and that maybe a good Extensibility Slot to add, but not possible at the moment.

There's a problem on onClick when it's not on BlockControls. Seems like click is disabled. Thanks!

Unfortunately, I can't debug all the issues you have in your plugin, a bit more efforts to find the source of these issues would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Help Request Help with setup, implementation, or "How do I?" questions.
Projects
None yet
Development

No branches or pull requests

2 participants