Skip to content

fix(ButtonDropdown) group={false} did nothing#425

Merged
eddywashere merged 6 commits intoreactstrap:masterfrom
tankorsmash:patch-1
May 14, 2017
Merged

fix(ButtonDropdown) group={false} did nothing#425
eddywashere merged 6 commits intoreactstrap:masterfrom
tankorsmash:patch-1

Conversation

@tankorsmash
Copy link
Copy Markdown
Contributor

The underlying Object.assign needs to have the overrides to the right it seems like

  let props = {group: "FROM PROPERTIES" };
  let propsOverwritten = Object.assign({}, props, {'group': "group from defaults"});
  console.log("props first, groups overwritten", propsOverwritten);
  
  let notOverwritten = Object.assign({}, {'group': "group from defaults"}, props);
  console.log("groups first, overwritten by props as intended", notOverwritten);
}


example()

ES6 example https://es6console.com/j2paoelc/

Not crazy sure, but I changed the order in reactstrap.es.js of g,{group:!0} and it worked, so this seems like it would have the appropriate affect.

tankorsmash and others added 6 commits May 14, 2017 18:55
The underlying Object.assign needs to have the overrides to the right it seems like

```function example(){
  let props = {group: "FROM PROPERTIES" };
  let propsOverwritten = Object.assign({}, props, {'group': "group from defaults"});
  console.log("props first, groups overwritten", propsOverwritten);
  
  let notOverwritten = Object.assign({}, {'group': "group from defaults"}, props);
  console.log("groups first, overwritten by props as intended", notOverwritten);
}


example()
```

ES6 example https://es6console.com/j2paoelc/

Not crazy sure, but I changed the order in `reactstrap.es.js` of `g,{group:!0}` and it worked, so this seems like it would have the appropriate affect.
@tankorsmash
Copy link
Copy Markdown
Contributor Author

Thanks for catching the space error, I missed that one too!

@eddywashere
Copy link
Copy Markdown
Member

@tankorsmash if you're looking to conditionally change the ButtonDropdown to a normal dropdown, I would recommend importing Dropdown and doing the check there. Also, this component could likely go away in a future release to simplify component list.

@eddywashere eddywashere merged commit 663551b into reactstrap:master May 14, 2017
@tankorsmash
Copy link
Copy Markdown
Contributor Author

@eddywashere No worries, I was purely trying to get rid of the group class because I have the button alone in a div. If you need to prune the component that's totally fine on my end, thanks!

@tankorsmash tankorsmash deleted the patch-1 branch May 14, 2017 23:57
tankorsmash added a commit to tankorsmash/Leagion that referenced this pull request May 16, 2017
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

Successfully merging this pull request may close these issues.

2 participants