Repository navigation
[@lexical/selection] Feature: yield target to style patch fn - #6472
Merged
Merged
Conversation
mrdivyansh
requested review from
Fetz,
Sahejkm,
acywatson,
fantactuka,
ivailop7,
potatowagon and
zurfyx
as code owners
July 29, 2024 10:28
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
etrepum
reviewed
Jul 31, 2024
| string | null | ((currentStyleValue: string | null) => string) | ||
| | string | ||
| | null | ||
| | ((currentStyleValue: string | null, _target: typeof target) => string) |
Collaborator
There was a problem hiding this comment.
Is there a need to underscore this parameter name? Does it get caught by the eslint shadow rule?
Suggested change
| | ((currentStyleValue: string | null, _target: typeof target) => string) | |
| | ((currentStyleValue: string | null, target: typeof target) => string) |
Contributor
Author
etrepum
approved these changes
Aug 4, 2024
etrepum
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, it seems reasonable to pass this information along and it's great that you've also added tests for this feature! One thing that might be a bit counter-intuitive is that the target is not necessarily the same target that is passed to $patchStyle since it will only be a RangeSelection when the given selection is collapsed
Contributor
Author
|
@etrepum , is there anything I need to do to get this PR merged? Thanks for approving the PR. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
$patchStyleText doesn't expose the target to the CSS property
patchfunction. However, it can be very helpful when the next style value may depend on the target node/selection.Test plan
Added unit tests
Before
After