Repository: plotly/dash

Issue:
Turn off undo/redo by default in Dash 1.0
The current solution to remove the undo-redo button is to [change the css of the page to hide it](https://community.plot.ly/t/is-it-possible-to-hide-the-floating-toolbar/4911/11) while [using a hosted css file](https://stackoverflow.com/questions/45137459/how-to-remove-the-undo-button-in-plotly-dash-after-a-dropdown-update). 

It would be much simpler to have an option that toggles this button, a bit like the graph toolbar.


Discussion:
@Moisan Thanks for writing in. This seems like a good feature to have within Dash. Adding some tags to encourage some discussion and collaboration.
Would very much appreciate this feature as well. I am having trouble using the workaround. While I will be able to do it, it seems like a useful feature to be able to config, rather than making messy code.
Is conditionally removing `<Toolbar/>` from 
```js
function UnconnectedAppContainer() {
    return (
        <Authentication>
            <div>
                <Toolbar/>
                <APIController/>
                <DocumentTitle/>
                <Loading/>
            </div>
        </Authentication>
    );
}
```
in [dash-renderer/src/AppContainer.react.js](https://github.com/plotly/dash-renderer/blob/04bd97a849cba04b70e69f4914004f511262181e/src/AppContainer.react.js) enough to get rid of it without breaking other things?
The undo button does not change anything for my dash app, which has input box and button.
My function looks like this:
```
@app.callback(Output('Docs', 'children'),
              [Input('button', 'n_clicks')],
              [State('input', 'value')])
def clean_data(n_clicks, input):
     if n_clicks is not None and input is not None:
            return ...
```
For example, I enter “A” in the input box and click the button, then enter “B” in the input box and click the button. Then clicking undo nothing is changed. I am hoping that the undo can go back to the result for “A”.
@Myijin I think this issue describes the behavior you are talking about https://github.com/plotly/dash-renderer/issues/66, does that sound right?

@rmarren1 That's right. When I only use the input box, the undo can go back to previous input. But it's not working after using button.
@Myijin Okay, I have a PR to fix this that is ready but have not merged, I'll see if I can expedite that
Is there any update on an easy option to remove the Undo-Redo button? I'll add my support for an easy toggle option as the button currently gets in the way of our dashboards.
Include a css file in the assets folder with this:

```
._dash-undo-redo {
  display: none;
}
```
@T4rk1n thanks! That took care of the issue (though I still think a toggle feature would be helpful as well)
I would like the undo-button but have no control over where it is displayed. For example, I don't want its position fixed but would like it as part of my menu bar as a relative element. A better feature would be to be able to supply positional css straight to the element, including display: none.
> I would like the undo-button but have no control over where it is displayed. For example, I don't want its position fixed but would like it as part of my menu bar as a relative element. A better feature would be to be able to supply positional css straight to the element, including display: none.

hmm What's wrong with using the `._dash-undo-redo` css class and add your desired custom style into your css stylesheet?

Resolving patch:
diff --git a/dash/dash.py b/dash/dash.py
--- a/dash/dash.py
+++ b/dash/dash.py
@@ -106,6 +106,7 @@ def __init__(
             external_stylesheets=None,
             suppress_callback_exceptions=None,
             components_cache_max_age=None,
+            show_undo_redo=False,
             plugins=None,
             **kwargs):
 
@@ -149,7 +150,8 @@ def __init__(
             'components_cache_max_age': int(get_combined_config(
                 'components_cache_max_age',
                 components_cache_max_age,
-                2678400))
+                2678400)),
+            'show_undo_redo': show_undo_redo
         })
 
         assets_blueprint_name = '{}{}'.format(
@@ -342,6 +344,7 @@ def _config(self):
             'requests_pathname_prefix': self.config.requests_pathname_prefix,
             'ui': self._dev_tools.ui,
             'props_check': self._dev_tools.props_check,
+            'show_undo_redo': self.config.show_undo_redo
         }
         if self._dev_tools.hot_reload:
             config['hot_reload'] = {


Test patch: