question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ToggleButton] docs: missing "size" property in the API docs

See original GitHub issue

I’m checking current API documentation for ToggleButton https://material-ui.com/api/toggle-button/, and I don’t see the size prop being mentioned there. But, the size property does affect the size of the ToggleButton. (I’m using the ToggleButton as a standalone though, not within the ToggleButtonGroup.)

Exploring the code for 4.11.0 I see this: https://github.com/mui-org/material-ui/blob/v4.11.0/packages/material-ui-lab/src/ToggleButton/ToggleButton.js#L78 https://github.com/mui-org/material-ui/blob/v4.11.0/packages/material-ui-lab/src/ToggleButton/ToggleButton.js#L159-L162

And in the next branch this: image

Does this mean the property is intentionally missing from the API, as it is not intended to be used by the users, so that it is only used internally by the enclosing ToggleButtonGroup component?

  • [ X] The issue is present in the latest release.
  • [ X] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

Expected Behavior 🤔

Steps to Reproduce 🕹

Steps:

Context 🔦

Your Environment 🌎

Tech Version
Material-UI v4.11.0
React
Browser
TypeScript
etc.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
eps1loncommented, Jul 28, 2020

The prop defaults to the value injected by the parent ToggleButtonGroup component, via cloneElement.

Whe should remove mention of any implementation specifics. If this is important for the usage (interface) then describe that instead of concrete methods used.

1reaction
oliviertassinaricommented, Jul 28, 2020

@croraf The latest change was in #21687 with @eps1lon, however, the size prop was already ignored before that. In any case, I think that it was before we made a standalone ToggleButton a viable use case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ToggleButton
android:autoSizeMaxTextSize, The maximum text size constraint to be used when ... family (named by string or as a font resource reference) for the...
Read more >
Gtk.ToggleButton
A GtkToggleButton is a GtkButton which will remain “pressed-in” when clicked. Clicking again will cause the toggle button to return to its normal...
Read more >
ToggleButton Class (System.Windows.Controls.Primitives)
Gets or sets a value indicating whether to clip the content of this element (or content coming from the child elements of this...
Read more >
ToggleButton (JavaFX 8)
A ToggleButton is a specialized control which has the ability to be selected. Typically a ToggleButton is rendered similarly to a Button.
Read more >
Toggle Button Reference - OutSystems 11 Documentation
Advanced use cases for the Toggle Button UI Pattern. - OutSystems 11 Documentation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found