@pingux/astro 1.42.2-alpha.1 → 1.42.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -173,6 +173,7 @@ var ColorField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
173
173
|
hasNoArrow: true,
|
174
174
|
isDismissable: true,
|
175
175
|
isNonModal: true,
|
176
|
+
isNotClosedOnBlur: true,
|
176
177
|
isOpen: popoverState.isOpen,
|
177
178
|
onClose: popoverState.close,
|
178
179
|
ref: overlayRef
|
@@ -68,4 +68,24 @@ test('will call onChange with arguments if provided', function () {
|
|
68
68
|
_userEvent["default"].type(hexInput, testColor2);
|
69
69
|
|
70
70
|
expect(testOnChange).toHaveBeenCalled();
|
71
|
+
});
|
72
|
+
test('clicking within the popover does not close it', function () {
|
73
|
+
var testOnChange = jest.fn();
|
74
|
+
getComponent({
|
75
|
+
onChange: testOnChange,
|
76
|
+
value: testColor1
|
77
|
+
});
|
78
|
+
|
79
|
+
var button = _testWrapper.screen.getByRole('button');
|
80
|
+
|
81
|
+
_userEvent["default"].click(button); // should be open now
|
82
|
+
|
83
|
+
|
84
|
+
var hexLabelElement = _testWrapper.screen.queryByText(hexLabel);
|
85
|
+
|
86
|
+
expect(hexLabelElement).toBeInTheDocument(); // click the popover container, which has caused closing in regressions
|
87
|
+
|
88
|
+
_userEvent["default"].click(_testWrapper.screen.queryByRole('presentation'));
|
89
|
+
|
90
|
+
expect(_testWrapper.screen.queryByRole('presentation')).toBeInTheDocument();
|
71
91
|
});
|
@@ -47,4 +47,19 @@ test('will call onChange with arguments if provided', function () {
|
|
47
47
|
userEvent.clear(hexInput);
|
48
48
|
userEvent.type(hexInput, testColor2);
|
49
49
|
expect(testOnChange).toHaveBeenCalled();
|
50
|
+
});
|
51
|
+
test('clicking within the popover does not close it', function () {
|
52
|
+
var testOnChange = jest.fn();
|
53
|
+
getComponent({
|
54
|
+
onChange: testOnChange,
|
55
|
+
value: testColor1
|
56
|
+
});
|
57
|
+
var button = screen.getByRole('button');
|
58
|
+
userEvent.click(button); // should be open now
|
59
|
+
|
60
|
+
var hexLabelElement = screen.queryByText(hexLabel);
|
61
|
+
expect(hexLabelElement).toBeInTheDocument(); // click the popover container, which has caused closing in regressions
|
62
|
+
|
63
|
+
userEvent.click(screen.queryByRole('presentation'));
|
64
|
+
expect(screen.queryByRole('presentation')).toBeInTheDocument();
|
50
65
|
});
|