Skip to content
Commits on Source (3)
## [105.1.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v105.1.0...v105.1.1) (2024-12-10)
### Bug Fixes
* **GlFilteredSearch:** allow passing null values to non multi select inputs ([01446a9](https://gitlab.com/gitlab-org/gitlab-ui/commit/01446a98d1afc579574e1bacad742788a0bf4837))
# [105.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v105.0.1...v105.1.0) (2024-12-06)
......
{
"name": "@gitlab/ui",
"version": "105.1.0",
"version": "105.1.1",
"description": "GitLab UI Components",
"license": "MIT",
"main": "dist/index.js",
......
......@@ -205,6 +205,18 @@ describe('Filtered search token segment', () => {
expect(wrapper.findComponent(GlFilteredSearchTokenSegment).emitted().input).toBe(undefined);
});
it('works as expected when the value is set to `null`', async () => {
createWrappedComponent({
active: true,
value: 'something',
});
await wrapper.setData({ value: null });
// Shouldn't emit anything
expect(wrapper.emitted('input')).toBeUndefined();
});
describe('applySuggestion', () => {
it('emits original token when no spaces are present', () => {
createComponent({ value: '' });
......
......@@ -232,6 +232,18 @@ export default {
if (this.multiSelect) return;
/**
* This is a temporary workaround to implement the same behaviour
* implemented in https://gitlab.com/gitlab-org/gitlab-ui/-/issues/2381
* for tokens with `terms-as-tokens=false` and `multi-select=false`.
*
* We're aiming to remove this temporary fix when
* https://gitlab.com/groups/gitlab-org/-/epics/15948 gets completed, as
* that refactoring will use the `@input` handler on the GlFilteredSearch
* component to handle tokens instead of doing workarounds.
*/
if (typeof newValue !== 'string') return;
const hasUnclosedQuote = newValue.split('"').length % 2 === 0;
if (newValue.indexOf(' ') === -1 || hasUnclosedQuote) {
return;
......