From 3adf4f497c8664b0836c9366d541f5793a87ba77 Mon Sep 17 00:00:00 2001 From: Cameron Clough Date: Mon, 10 Jul 2023 16:01:00 +0200 Subject: [PATCH] DeviceList: fix iOS scroll refresh bug (#397) --- src/components/Dashboard/DeviceList.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/Dashboard/DeviceList.jsx b/src/components/Dashboard/DeviceList.jsx index 06af46e8..90a96a8d 100644 --- a/src/components/Dashboard/DeviceList.jsx +++ b/src/components/Dashboard/DeviceList.jsx @@ -93,10 +93,13 @@ class DeviceList extends Component { settingsModalDongleId: null, }; + this.container = React.createRef(); + this.renderDevice = this.renderDevice.bind(this); this.handleOpenedSettingsModal = this.handleOpenedSettingsModal.bind(this); this.handleClosedSettingsModal = this.handleClosedSettingsModal.bind(this); this.onVisible = this.onVisible.bind(this); + this.onRef = this.onRef.bind(this); } handleOpenedSettingsModal(dongleId, ev) { @@ -109,6 +112,13 @@ class DeviceList extends Component { this.setState({ settingsModalDongleId: null }); } + onRef(el) { + this.container.current = el; + if (el) { + el.addEventListener('touchstart', (ev) => ev.stopPropagation()); + } + } + async onVisible() { const { dispatch } = this.props; if (MyCommaAuth.isAuthenticated()) { @@ -194,6 +204,7 @@ class DeviceList extends Component { <>