Skip to content

bootstrapToggle("RENDERER") method name inconsistent with documented "rerender" #313

Description

@palcarazm

Error Description

The bootstrapToggle method incorrectly uses RENDERER as the method name when the documentation and actual implementation use rerender. This creates confusion for developers and requires referencing the source code to discover the correct method name.

Steps to Reproduce

const toggle = document.getElementById('my-toggle');
toggle.bootstrapToggle('rerender');  // Works as documented
toggle.bootstrapToggle('RENDERER');  // Also works (undocumented)

The enum exported in the TypeScript definitions includes RENDERER = "RENDERER", but the documented method name is "rerender" (lowercase). Both work due to case-insensitive handling, but the naming is inconsistent.

Expected Behavior

The method name should be consistently rerender (lowercase) in both documentation and TypeScript enums to match standard JavaScript conventions.

Actual Behavior

The TypeScript enum BootstrapToggleMethods defines RENDERER = "RENDERER" (uppercase), while the documented method uses "rerender". The inconsistency may lead developers to use the wrong case or assume the enum value is the correct string to pass.

Severity

Minimal

Bootstrap 5 Toggle Version

5.3.0

Bootstrap version

5.3.8

Other

This issue was discovered while implementing accessibility features in bs-darkmode-toggle, where we needed to call rerender after updating aria-label. The enum value RENDERER works but doesn't match the documentation.

Bug Report Checklist

  • Confirm that you agree to follow the project's code of conduct.
  • Confirm that you have reviewed open and rejected anomalies and have not found the reported anomaly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions