bee-form-control
Advanced tools
Comparing version 2.0.24 to 2.0.25
@@ -29,2 +29,4 @@ 'use strict'; | ||
var _tinperBeeCore = require('tinper-bee-core'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
@@ -92,2 +94,3 @@ | ||
_this.clickClearBtn = false; | ||
_this.isAutoFocusFlag = true; | ||
return _this; | ||
@@ -106,2 +109,11 @@ } | ||
FormControl.prototype.componentDidUpdate = function componentDidUpdate() { | ||
// 判断modal中包含input时自动获取焦点失败问题 | ||
var parentNode = _tinperBeeCore.cssUtil.parentsUntil(this.input); | ||
if (this.props.autoFocus && this.isAutoFocusFlag && parentNode.className === 'u-modal-content') { | ||
this.input.focus(); | ||
this.isAutoFocusFlag = false; | ||
} | ||
}; | ||
FormControl.prototype.render = function render() { | ||
@@ -108,0 +120,0 @@ |
{ | ||
"name": "bee-form-control", | ||
"version": "2.0.24", | ||
"version": "2.0.25", | ||
"description": "form-control ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -6,2 +6,3 @@ import React, {Component} from 'react'; | ||
import TextArea from 'rc-textarea' | ||
import { cssUtil } from 'tinper-bee-core' | ||
@@ -54,2 +55,3 @@ const propTypes = { | ||
this.clickClearBtn = false; | ||
this.isAutoFocusFlag = true | ||
} | ||
@@ -69,2 +71,11 @@ | ||
componentDidUpdate(){ | ||
// 判断modal中包含input时自动获取焦点失败问题 | ||
let parentNode = cssUtil.parentsUntil(this.input) | ||
if (this.props.autoFocus && this.isAutoFocusFlag && parentNode.className === `u-modal-content`) { | ||
this.input.focus() | ||
this.isAutoFocusFlag = false | ||
} | ||
} | ||
handleSearchChange = (e) => { | ||
@@ -71,0 +82,0 @@ const {onChange} = this.props; |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
60809
1379
1