Skip to content

Remove unnecessary suggestion types in LinkControl  #20051

@getdave

Description

@getdave

We should extract these types into a CONSTANT as it is used across the entire component.

Over time, I've begun to question whether we even need these. I feel like I may have left a similar comment recently elsewhere, but: For what purpose do we assign type for manually-entered URLs? It seems like a lot of extra work to assign and accommodate, when it may just be enough to assign nothing, and use the absence of a type as an indicator of a value being manually-entered.

isDirectEntry = ! value.type;

Edit: Not suggesting this be done as part of this pull request, but I would consider it as an alternative to a refactoring it.

Originally posted by @aduth in https://github.com/_render_node/MDE3OlB1bGxSZXF1ZXN0UmV2aWV3MzUzMTM3NTAx/pull_request_reviews/more_threads

Metadata

Metadata

Assignees

Labels

[Feature] Link EditingLink components (LinkControl, URLInput) and integrations (RichText link formatting)[Feature] UI ComponentsImpacts or related to the UI component system[Status] In ProgressTracking issues with work in progress[Type] Code QualityIssues or PRs that relate to code quality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions