Skip to content

Commit e230f39

Browse files
small fixes (#392)
1 parent 0a794e7 commit e230f39

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

src/components/fields/derived.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ export const LayoutNumericFractionInverse = connectLayoutToPlot(
289289

290290
export const AnnotationArrowRef = connectToContainer(UnconnectedDropdown, {
291291
modifyPlotProps: (props, context, plotProps) => {
292+
if (!context.fullContainer) {
293+
return;
294+
}
292295
const {fullContainer: {xref, yref}} = context;
293296

294297
let currentAxisRef;
@@ -325,6 +328,9 @@ export const AnnotationArrowRef = connectToContainer(UnconnectedDropdown, {
325328

326329
export const AnnotationRef = connectToContainer(UnconnectedDropdown, {
327330
modifyPlotProps: (props, context, plotProps) => {
331+
if (!context.fullContainer) {
332+
return;
333+
}
328334
const {fullContainer: {axref, ayref}} = context;
329335

330336
let currentOffsetRef;

src/components/widgets/EditableText.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class EditableText extends Component {
1313
this.handleChange = this.handleChange.bind(this);
1414
this.handleUpdate = this.handleUpdate.bind(this);
1515
this.handleKeyPress = this.handleKeyPress.bind(this);
16+
this.handleWheel = this.handleWheel.bind(this);
1617
this.getRef = this.getRef.bind(this);
1718
}
1819

@@ -48,6 +49,12 @@ class EditableText extends Component {
4849
}
4950
}
5051

52+
handleWheel(event) {
53+
if (this.props.onWheel && document.activeElement === this._ref) {
54+
this.props.onWheel(event);
55+
}
56+
}
57+
5158
render() {
5259
const {
5360
type,
@@ -57,7 +64,6 @@ class EditableText extends Component {
5764
autoFocus,
5865
onKeyDown,
5966
placeholder,
60-
onWheel,
6167
readOnly,
6268
size,
6369
} = this.props;
@@ -74,7 +80,7 @@ class EditableText extends Component {
7480
autoFocus={autoFocus}
7581
onKeyPress={this.handleKeyPress}
7682
onKeyDown={onKeyDown}
77-
onWheel={onWheel}
83+
onWheel={this.handleWheel}
7884
placeholder={placeholder}
7985
readOnly={readOnly}
8086
size={size}

src/components/widgets/NumericInput.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ export default class NumericInput extends Component {
3939
}
4040

4141
onWheel(e) {
42+
e.stopPropagation();
43+
e.preventDefault();
4244
if (e.deltaY > 0) {
4345
this.incrementValue('increase');
4446
} else {
4547
this.incrementValue('decrease');
4648
}
47-
e.stopPropagation();
4849
}
4950

5051
onChange(value) {

0 commit comments

Comments
 (0)