fix(richtext-lexical): dropdown item disabled status (#8159)
## Description
It is possible to disable arbitrary items from a toolbar dropdown menu
with the `isEnabled` property. In order to illustrate the changes in
this PR, I have introduced the following lines in the
`HeadingFeatureClient` located at
`packages/richtext-lexical/src/features/heading/client/index.tsx`.
```ts
isEnabled: () => {
return headingSize === 'h2'
},
```
**Before this PR**


**After this PR**


packages/richtext-lexical/src/features/heading/client/index.tsx
- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.
## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug fix (non-breaking change which fixes an issue)
## Checklist:
- [x] Existing test suite passes locally with my changes
This commit is contained in:
@@ -88,6 +88,10 @@
|
||||
&.active {
|
||||
background-color: var(--theme-elevation-100);
|
||||
}
|
||||
&.disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
padding-left: 6.25px;
|
||||
padding-right: 6.25px;
|
||||
|
||||
Reference in New Issue
Block a user