superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [incubator-superset] branch omnibar updated: removed jquert
Date Sun, 27 Jan 2019 19:29:54 GMT
This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch omnibar
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/omnibar by this push:
     new 66021ba  removed jquert
66021ba is described below

commit 66021baf0e3b845adb0ea73bab5b4a273d6fa453
Author: hughhhh <hmiles@lyft.com>
AuthorDate: Sun Jan 27 14:29:35 2019 -0500

    removed jquert
---
 superset/assets/src/dashboard/components/Dashboard.jsx | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/superset/assets/src/dashboard/components/Dashboard.jsx b/superset/assets/src/dashboard/components/Dashboard.jsx
index a1a8c8d..fceb1df 100644
--- a/superset/assets/src/dashboard/components/Dashboard.jsx
+++ b/superset/assets/src/dashboard/components/Dashboard.jsx
@@ -20,7 +20,6 @@ import React from 'react';
 import { Modal } from 'react-bootstrap';
 import PropTypes from 'prop-types';
 import { t } from '@superset-ui/translation';
-import $ from 'jquery';
 
 import getChartIdsFromLayout from '../util/getChartIdsFromLayout';
 import DashboardBuilder from '../containers/DashboardBuilder';
@@ -104,6 +103,8 @@ class Dashboard extends React.PureComponent {
     this.initTs = new Date().getTime();
 
     this.handleKeydown = this.handleKeydown.bind(this);
+
+    this.exampleRef = React.createRef();
   }
 
   componentDidMount() {
@@ -229,7 +230,13 @@ class Dashboard extends React.PureComponent {
       const isK = event.key === 'k' || event.keyCode === 83;
       if (isK) {
         this.setState({ showOmni: !this.state.showOmni });
-        $('.modal-dialog:first input').focus();
+
+        // Get first input in the modal div
+        document
+          .getElementsByClassName('modal-dialog')[0]
+          .getElementsByTagName('input')[0]
+          .focus();
+
         Logger.send(
           new ActionLog({
             impressionId: this.props.impressionId,
@@ -268,7 +275,7 @@ class Dashboard extends React.PureComponent {
   render() {
     return (
       <div>
-        <Modal show={this.state.showOmni}>
+        <Modal show={this.state.showOmni} ref={this.exampleRef}>
           <OmniContianer />
         </Modal>
         <DashboardBuilder />


Mime
View raw message