Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions packages/rich-text/src/component/use-default-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,11 @@ import { useCallback } from '@wordpress/element';
*/
const whiteSpace = 'pre-wrap';

/**
* A minimum width of 1px will prevent the rich text container from collapsing
* to 0 width and hiding the caret. This is useful for inline containers.
*/
const minWidth = '1px';

export function useDefaultStyle() {
return useCallback( ( element ) => {
if ( ! element ) {
return;
}
element.style.whiteSpace = whiteSpace;
element.style.minWidth = minWidth;
}, [] );
}
Loading