Skip to content

ToggleSwitch simplified #925

@victorfunes

Description

@victorfunes
  • I have searched the Issues to see if this bug has already been reported
  • I have tested the latest version

Summary

The ToggleSwitch component is requiring always parameters that are not always being to be used.
Request: change to optional some of them.

Context

I am creating a form just to visualize information, and due to the screen design, I cannot use the embedded label, but it is mandatory to define one.
As it is only for information, it is not going to change, but the onChange function is also mandatory.

Example: I have to implement this design using label="" and onChange={() => {}} and generating unnecessary warnings in my code.

image

            <Label
              htmlFor={"automatedAssignment"}
              className="text-xs font-normal text-gray-900 select-none">
              Allow automatic assignment
            </Label>
            <ToggleSwitch
              id="automatedAssignment"
              label=""
              color="blue"
              checked={automaticAssignmentEnabled ?? false}
              onChange={() => {}}
            />

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions