-
Notifications
You must be signed in to change notification settings - Fork 168
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
Add style option to custom controls #126
Open
steurt
wants to merge
7
commits into
niuware:master
Choose a base branch
from
steurt:feature/custom-component-style
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ng them in the events example
…a fallback to the name if none is specified
…g custom header controls
steurt
changed the title
Add style option to custom components
Add style option to custom controls
Jun 2, 2020
What do you think about this PR @niuware? |
…ure/custom-component-style
@niuware you've made changes since this PR has been created. I've merged these changes. Could you please check this PR out? |
theoxys
approved these changes
Jun 22, 2021
dersimoezdag
approved these changes
Jun 30, 2021
Is this still ongoing ? Seems blocked. I would like to add a "CENTER" (alignment) custom control, without success |
corneliugaina
approved these changes
Mar 30, 2022
Up, useful feature that allows customization of the default controls, it is kind of like undocumented feature now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm using mui-rte as a rich text editor and I've integrated it nicely with the rest of my Material UI React application. There are some things I want to configure about the editor. This PR is about one of those things.
Instead of the default 'title' control, I want to make use of several header controls. They are default supported by Draft.js but not by mui-rte. I hoped to simply provide a custom control to mui-rte with the proper style specified, so Draft.js will do the rest (e.g.
header-one
,header-two
). This unfortunately was not an option.For custom controls in mui-rte you can't specify the style. You can specify the name, which in turn is used as the style, but it is transformed to upper case first. So the
header-one
name would become theHEADER-ONE
style and Draft.js won't interpret that as the header one block.With this PR, I've added the
style
option to the custom component so you can optionally specify the style of a custom control explicitly. If none is specified, it falls back to the component name, but it doesn't transform it to upper case. Along with the change I updated the custom controls example to show the use of theheader-one
–header-three
.