Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
didSelect (value) {
const field = this.props.adapter.context
this.setState({
options: [],
isOpen: false,
markAtIndex: undefined
})
this.props.onChange(this.props.propName, field.fromString(value))
// Blur focus to emphasize that selection has been done
findDOMNode(this._inputNode).blur()
}
componentDidMount () {
let domEl = findDOMNode(this)
domEl.addEventListener('dragstart', this.handleDragStart, false)
domEl.addEventListener('dragover', this.handleDragOver, false)
domEl.addEventListener('dragenter', this.handleDragEnter, false)
domEl.addEventListener('dragleave', this.handleDragLeave, false)
domEl.addEventListener('dragend', this.handleDragEnd, false)
domEl.addEventListener('drop', this.handleDrop, false)
this.listenersAdded = true
// Because this is a container we set isMounted here instead of getting it from parent
this.isMounted = true
}
function animateCrossFadeIn(component, currSize, animationName, callback) {
const domEl = findDOMNode(component)
const height = domEl.offsetHeight + 'px'
const width = domEl.offsetWidth + 'px'
domEl.style.height = currSize.height
domEl.style.width = currSize.width
domEl.classList.add(animationName + '-enter')
// Trigger reflow
const tmp = domEl.offsetHeight
// 2. Set an animation listener, code at end
var done = false
var nrofTransitionsLeft
const onTransitionEnd = (event) => {
it('Should return true if that is the ndoe', () => {
const vNode = <div>Ok</div>;
render(
<div>
<span>Test</span>
{vNode}
</div>,
container
);
expect(isDOMinsideVNode(container.querySelector('#target'), vNode)).toBe(true);
});
});
}
render() {
return (
<div>
<span>
</span></div>
);
}
}
render(, container);
const target = container.querySelector('#target');
expect(isDOMinsideComponent(target, instance)).toBe(true);
});
expect(isDOMinsideComponent(target, instances[0])).toBe(false);
expect(isDOMinsideComponent(target, instances[1])).toBe(true);
expect(isDOMinsideComponent(target, instances[2])).toBe(false);
render(
<div>
</div>,
container
);
expect(isDOMinsideComponent(target, instances[0])).toBe(false);
expect(isDOMinsideComponent(target, instances[1])).toBe(false);
expect(isDOMinsideComponent(target, instances[2])).toBe(false);
});
});
getContainer() {
return findDOMNode(this);
}
componentWillUnmount () {
const node = findDOMNode(this)
this.props.onLeave(node)
setTimeout(() => animateOnRemove(node, this.props.prefix))
}
_animationCheck () {
if (this.state.active && this.targetSize && this.sourceSize && findDOMNode(this)) {
animateSizeChange(findDOMNode(this), this.props.prefix, this.sourceSize, this.targetSize)
this.targetSize = this.sourceSize = undefined
}
}
function getContentSize() {
const domEl = findDOMNode(this)
return {
width: domEl.offsetWidth + 'px',
height: domEl.offsetHeight + 'px'
}
}