mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-03-31 22:42:37 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a94367bdcb | ||
|
|
65febbbc52 | ||
|
|
b14d2e5bd8 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-web",
|
||||
"version": "0.0.67",
|
||||
"version": "0.0.68",
|
||||
"description": "React Native for Web",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
|
||||
@@ -28,8 +28,8 @@ const initialize = () => {
|
||||
);
|
||||
injector.addRule(
|
||||
'pointer-events',
|
||||
'.rn-pointerEvents\\:auto,.rn_pointerEvents\\:box-only,.rn-pointerEvents\\:box-none *{pointer-events:auto}' +
|
||||
'.rn-pointerEvents\\:none,.rn_pointerEvents\\:box-only *,.rn-pointerEvents\\:box-none{pointer-events:none}'
|
||||
'.rn-pointerEvents\\:auto,.rn-pointerEvents\\:box-only,.rn-pointerEvents\\:box-none *{pointer-events:auto}' +
|
||||
'.rn-pointerEvents\\:none,.rn-pointerEvents\\:box-only *,.rn-pointerEvents\\:box-none{pointer-events:none}'
|
||||
);
|
||||
|
||||
const classNames = injector.getClassNames();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import applyLayout from '../../modules/applyLayout';
|
||||
import applyNativeMethods from '../../modules/applyNativeMethods';
|
||||
import NativeMethodsMixin from '../../modules/NativeMethodsMixin';
|
||||
import createDOMElement from '../../modules/createDOMElement';
|
||||
import findNodeHandle from '../../modules/findNodeHandle';
|
||||
import StyleSheet from '../../apis/StyleSheet';
|
||||
import Text from '../Text';
|
||||
import TextareaAutosize from 'react-textarea-autosize';
|
||||
import TextInputState from './TextInputState';
|
||||
import UIManager from '../../apis/UIManager';
|
||||
import View from '../View';
|
||||
import { Component, PropTypes } from 'react';
|
||||
|
||||
@@ -116,7 +116,7 @@ class TextInput extends Component {
|
||||
}
|
||||
|
||||
setNativeProps(props) {
|
||||
UIManager.updateView(this._node, props, this);
|
||||
NativeMethodsMixin.setNativeProps.call(this, props);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
@@ -10,6 +10,7 @@ import findNodeHandle from '../findNodeHandle';
|
||||
import StyleRegistry from '../../apis/StyleSheet/registry';
|
||||
import UIManager from '../../apis/UIManager';
|
||||
|
||||
const emptyObject = {};
|
||||
const REGEX_CLASSNAME_SPLIT = /\s+/;
|
||||
const REGEX_STYLE_PROP = /rn-(.*):.*/;
|
||||
|
||||
@@ -83,7 +84,7 @@ const NativeMethodsMixin = {
|
||||
const domClassList = [ ...node.classList ];
|
||||
|
||||
// Resolved state
|
||||
const resolvedProps = StyleRegistry.resolve(nativeProps.style);
|
||||
const resolvedProps = StyleRegistry.resolve(nativeProps.style) || emptyObject;
|
||||
const resolvedClassList = classNameToList(resolvedProps.className);
|
||||
|
||||
// Merged state
|
||||
@@ -94,7 +95,8 @@ const NativeMethodsMixin = {
|
||||
// Only pass on a class name when the style is unchanged.
|
||||
domClassList.forEach((c) => {
|
||||
const prop = getStyleProp(c);
|
||||
if (resolvedProps.className.indexOf(prop) === -1) {
|
||||
const className = resolvedProps.className;
|
||||
if (!className || className.indexOf(prop) === -1) {
|
||||
classList.push(c);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user