Headline buttons are broken in the Custom Inline Toolbar Example
These buttons "HeadlineOneButton", "HeadlineTwoButton", "HeadlineThreeButton" are broken in the Custom Inline Toolbar Example.
Tested on Chrome and Firefox.
#951 PR resolves the problem you reported, sadly the bugfix it's not yet merged.
@slobodanl: Thanks for the PR, hoping for it to be merged soon.
Will the PR https://github.com/draft-js-plugins/draft-js-plugins/pull/951 solve the case when overrideContent is not used?
In this sandbox I have a button wherein I just want to have an alert show up when it is clicked but the click goes right through it.
Any ideas?
@divyenduz PR #951 effectively resolves the problem with overrideContent functionality case when you want to render custom component as result of toolbar button onClick. I don't think that your specific use case will be supported, nevertheless, I don't think that alerting is useful by itself so maybe what you are actually up for is rendering custom content in the inline toolbar?
What I actually want to achieve is this - which is to enter a custom block mode when I click an inline toolbar button.
But I am not able to get the click callback right, I might be doing something stupid. This is where I was just trying to add a custom inline button to the inline toolbar but the click just goes through the button.
@divyenduz Please take a look into https://www.draft-js-plugins.com/plugin/image , Add Image Button Example for some ideas how you can employ custom button to insert a new custom block into the draft editor.
In case of the inline plugin, this can be reworked as a custom button that will render custom component with input and ADD button using overrideContent functionality and on ADD onClick call the appropriate plugin modifier e.g. addImage.
I suggest to take a moment and review some source code in Video or Image plugin.
Hope this comment helps you.
Thanks for the detailed comment, in my case, I do not want to use the overrideContent but directly enter the custom block mode, but the first click as I have demonstrated in my example, just passes through the inline toolbar. I will revisit this shortly and share my findings.
@slobodanl, Is there any hope that this PR #951 will be merged soon?