Skip to content

Commit

Permalink
Improve inline documentation (#41209)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored May 23, 2022
1 parent 5ad090d commit 7af38a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/reference-guides/data/data-core-block-editor.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ function useAutocomplete( {
event.preventDefault();
}

// textContent is a primitive (string), memoizing is not strictly necessary
// but this is a preemptive performance improvement, since the autocompleter
// is a potential bottleneck for the editor type metric.
const textContent = useMemo( () => {
if ( isCollapsed( record ) ) {
return getTextContent( slice( record, 0 ) );
Expand Down

0 comments on commit 7af38a3

Please sign in to comment.