Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScopedComponent doesn't always respect initial component type #1154

Open
Fusezion opened this issue Jan 10, 2025 · 1 comment
Open

ScopedComponent doesn't always respect initial component type #1154

Fusezion opened this issue Jan 10, 2025 · 1 comment

Comments

@Fusezion
Copy link

Fusezion commented Jan 10, 2025

While messing around with some components, an issue arose when using Component#font(Key) on its own outside of builders. It doesn't respect the initial provided component type in it's returned output.

Image

EDIT: after a bit more messing around these are all the effected methods

ScopedComponent#font(Key),
ScopedComponent#style(Consumer<Builder>, Strategy),
ScopedComponent#appendNewLine(),
ScopedComponent#appendSpace(),
ScopedComponent#applyFallbackStyle(StyleBuilderApplicable...),
ScopedComponent#applyFallbackStyle(Style),
ScopedComponent#decorate(TextDecoration....),
ScopedComponent#decorateIfAbsent(TextDecoration, TextDecoration$State),
ScopedComponent#decorations(Set<TextDecoration>, boolean),
ScopedComponent#decorations(Map<TextDecoration, TextDecoration$State>),
ScopedComponent#replaceText(Consumer<Builder>), and
ScopedComponent#replaceText(TextReplacementConfig)

I've left out the #compact method since just like #asComponent it seems more intentional design wise for it to be Component

@zml2008
Copy link
Member

zml2008 commented Jan 10, 2025

see ScopedComponent

@Fusezion Fusezion changed the title Component#font doesn't respect initial component type ScopedComponent doesn't always respect initial component type Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants