From 8b61f2a11d5118dd66df22390d5a1f419d32f93e Mon Sep 17 00:00:00 2001 From: Wout Mertens Date: Mon, 25 Jul 2016 18:50:31 +0200 Subject: [PATCH] Use autoFocus where possible React does the right thing with it and Elemental-UI already supports it: https://github.com/elementalui/elemental/issues/165 This removes stateful code. It also works in the Modal because the Modal will not render its contents until it opens: https://github.com/elementalui/elemental/blob/620efc246d7f5fd123a2af3fa7f07bf4e745a0fb/src/components/Modal.js#L127-L128 --- .../App/screens/List/components/ListColumnsForm.js | 8 ++------ .../App/screens/List/components/ListDownloadForm.js | 2 +- admin/client/App/screens/List/components/ListSort.js | 4 +--- admin/client/App/shared/ConfirmationDialog.js | 9 +-------- fields/types/geopoint/GeoPointFilter.js | 2 +- fields/types/location/LocationField.js | 4 ++-- fields/types/location/LocationFilter.js | 2 +- fields/types/name/NameField.js | 2 +- fields/types/relationship/RelationshipFilter.js | 2 +- fields/types/text/TextFilter.js | 2 +- fields/types/textarray/TextArrayFilter.js | 2 +- 11 files changed, 13 insertions(+), 26 deletions(-) diff --git a/admin/client/App/screens/List/components/ListColumnsForm.js b/admin/client/App/screens/List/components/ListColumnsForm.js index 12a5a91bb0..ac54b74145 100644 --- a/admin/client/App/screens/List/components/ListColumnsForm.js +++ b/admin/client/App/screens/List/components/ListColumnsForm.js @@ -30,10 +30,6 @@ var ListColumnsForm = React.createClass({ selectedColumns: this.getSelectedColumnsFromStore(), isOpen: visible, searchString: '', - }, () => { - if (visible) { - this.refs.search.focus(); - } }); }, toggleColumn (path, value) { @@ -89,7 +85,7 @@ var ListColumnsForm = React.createClass({ render () { return ( -