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

Improve inline documentation #41209

Merged
merged 3 commits into from May 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/reference-guides/data/data-core-block-editor.md
Expand Up @@ -1471,11 +1471,11 @@ _Parameters_

### setBlockVisibility

Action that sets whether a block has controlled inner blocks.
Action that sets whether given blocks are visible on the canvas.

_Parameters_

- _updates_ `Record<string,boolean>`: The block's clientId.
- _updates_ `Record<string,boolean>`: For each block's clientId, its new visibility setting.

### setHasControlledInnerBlocks

Expand Down
4 changes: 2 additions & 2 deletions packages/block-editor/src/store/actions.js
Expand Up @@ -1605,9 +1605,9 @@ export function setHasControlledInnerBlocks(
}

/**
* Action that sets whether a block has controlled inner blocks.
* Action that sets whether given blocks are visible on the canvas.
*
* @param {Record<string,boolean>} updates The block's clientId.
* @param {Record<string,boolean>} updates For each block's clientId, its new visibility setting.
*/
export function setBlockVisibility( updates ) {
return {
Expand Down
3 changes: 3 additions & 0 deletions packages/components/src/autocomplete/index.js
Expand Up @@ -269,6 +269,9 @@ function useAutocomplete( {
event.preventDefault();
}

// textContent is a primitive (string), memoizing is not strictly necessary
// but since the autocompleter is a potential bottleneck for the editor type metric
// it's over optimized.
youknowriad marked this conversation as resolved.
Show resolved Hide resolved
const textContent = useMemo( () => {
if ( isCollapsed( record ) ) {
return getTextContent( slice( record, 0 ) );
Expand Down