@open-mercato/ui 0.8.1-develop.7241.1.fad7b2ce2a → 0.8.1-develop.7254.1.ab24f26208

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/ui",
3
- "version": "0.8.1-develop.7241.1.fad7b2ce2a",
3
+ "version": "0.8.1-develop.7254.1.ab24f26208",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -155,14 +155,14 @@
155
155
  "remark-gfm": "^4.0.1"
156
156
  },
157
157
  "peerDependencies": {
158
- "@open-mercato/shared": "0.8.1-develop.7241.1.fad7b2ce2a",
158
+ "@open-mercato/shared": "0.8.1-develop.7254.1.ab24f26208",
159
159
  "react": ">=18.0.0",
160
160
  "react-dom": ">=18.0.0",
161
161
  "react-is": ">=18.0.0"
162
162
  },
163
163
  "devDependencies": {
164
164
  "@figma/code-connect": "^1.3.4",
165
- "@open-mercato/shared": "0.8.1-develop.7241.1.fad7b2ce2a",
165
+ "@open-mercato/shared": "0.8.1-develop.7254.1.ab24f26208",
166
166
  "@testing-library/dom": "^10.4.1",
167
167
  "@testing-library/jest-dom": "^7.0.1",
168
168
  "@testing-library/react": "^16.3.3",
@@ -85,6 +85,27 @@ describe('ComboboxInput clearable behavior', () => {
85
85
  expect(onChange).not.toHaveBeenCalled()
86
86
  })
87
87
 
88
+ // Display text that matches what the user typed is not proof the value was committed: an
89
+ // unselected query renders identically to a picked option's label until blur resolves it.
90
+ // Playwright helpers that assert only `toHaveValue(typedText)` before blur therefore report
91
+ // success on a field the form never received, so the blur-clear below is the observable
92
+ // signal they must key on.
93
+ it('leaves the value uncommitted and clears the input on blur when the typed text matches no option', () => {
94
+ const onChange = jest.fn()
95
+ render(<Harness allowCustomValues={false} onChange={onChange} />)
96
+
97
+ const input = screen.getByRole('combobox') as HTMLInputElement
98
+ fireEvent.focus(input)
99
+ fireEvent.change(input, { target: { value: 'Blue' } })
100
+ expect(input.value).toBe('Blue')
101
+
102
+ blurAndFlush(input)
103
+
104
+ expect(onChange).not.toHaveBeenCalled()
105
+ expect(screen.getByTestId('value')).toHaveTextContent('')
106
+ expect(input.value).toBe('')
107
+ })
108
+
88
109
  it('emits empty string on blur with empty input when clearable, regardless of allowCustomValues', () => {
89
110
  const onChange = jest.fn()
90
111
  render(