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

Feature Request: Conditionally Render Number Inputs Based on Attribute #4

Open
7evenk opened this issue Jun 23, 2024 · 0 comments
Open
Assignees

Comments

@7evenk
Copy link
Contributor

7evenk commented Jun 23, 2024

Description:
Currently, the SliderWebcomponent always renders the number inputs alongside the range sliders. For enhanced flexibility and customization, we propose adding an attribute that controls the rendering of these number inputs. When this attribute is set, the number inputs should be created and displayed; otherwise, they should be omitted from the DOM entirely.

Proposed Solution:

Introduce a new attribute (e.g., show-number-inputs) to the SliderWebcomponent.
Modify the component's template rendering logic to conditionally include the number inputs based on the presence and value of this attribute.
Ensure that the component's behavior (such as event handling and attribute synchronization) remains consistent regardless of whether the number inputs are rendered.
Acceptance Criteria:

The number inputs are only rendered when the show-number-inputs attribute is present.
If the attribute is not set, only the range sliders are displayed.
The component functions correctly with or without the number inputs, maintaining all existing features and behaviors.
Example Usage:

<!-- Number inputs are rendered -->
<node-projects-slider value-min="10" value-max="50" min="0" max="100" show-number-inputs></node-projects-slider>

<!-- Number inputs are not rendered -->
<node-projects-slider value-min="10" value-max="50" min="0" max="100"></node-projects-slider>

Additional Notes:

This feature will enhance the usability of the component, allowing developers to choose a more compact slider-only UI when the number inputs are not necessary.

@7evenk 7evenk self-assigned this Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant