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

RichText: document disableEditing property #59755

Closed
wants to merge 1 commit into from

Conversation

retrofox
Copy link
Contributor

What?

It documents the RichText disableEditing property

Why?

Improve documentation

How?

Just editing the Readme file.

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

@retrofox retrofox self-assigned this Mar 11, 2024
@retrofox retrofox marked this pull request as ready for review March 11, 2024 14:42
Copy link

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: retrofox <retrofox@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@retrofox retrofox added the [Type] Developer Documentation Documentation for developers label Mar 11, 2024
@retrofox retrofox marked this pull request as draft March 11, 2024 15:32
@ellatrix
Copy link
Member

Isn't this an internal thing? Why not reuse the contentEditable prop instead?

@retrofox
Copy link
Contributor Author

Yes, it's an external thing so far. That's why I moved the PR to draft.
I talked with @glendaviesnz about creating this PR.
It would be nice to set that property externally, for instance, disable the text field for a custom block in the Product Editor (Woocommerce product editor). woocommerce/woocommerce#42736 (comment)

@ellatrix
Copy link
Member

It would be nice to stick to normal HTML attributes like contentEditable={ false } or readonly.

@glendaviesnz
Copy link
Contributor

I talked with @glendaviesnz about creating this PR.

Sorry, I probably didn't make it clear in the discussion, rather than just documenting it we would need to go through the process of taking this out of the experimental APIs first as we don't document experimental APIs. We should look into Ella's concerns though before doing that.

It would be nice to stick to normal HTML attributes like contentEditable={ false } or readonly.

From memory, there was some reason why these attributes did not work in the context of the pattern overrides. I can't remember exactly what the problem was, but will have another look during the week and see if I can recall what the issues were.

@glendaviesnz
Copy link
Contributor

glendaviesnz commented Mar 31, 2024

This was the reason we didn't use contentEditable. We could revisit this, as in fact the disableEditing flag is only ending up as a false flag on the RichText component contentEditable anyway, but will try switching to readonly for starters as that seems slightly better than drilling down contentEditable.

@glendaviesnz
Copy link
Contributor

glendaviesnz commented Apr 1, 2024

@ellatrix looks like switching this to readonly works. I agree that this makes for a better API if we make this public than disableEditing.

What are your thoughts on this, and on the possibility of making this part of the public API? Happy to switch it to contentEditable if you think that is better.

@ellatrix
Copy link
Member

ellatrix commented Apr 1, 2024

That's fine

@retrofox retrofox closed this Apr 11, 2024
@ellatrix ellatrix deleted the update/doc-rich-text-disable-editing branch April 11, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
3 participants