Skip to content

Commit

Permalink
[8.17] [controls] fix Korean characters split into 2 characters with …
Browse files Browse the repository at this point in the history
…space in between when typing in options list search input (#213164) (#213176)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[controls] fix Korean characters split into 2 characters with space
in between when typing in options list search input
(#213164)](#213164)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2025-03-04T23:43:38Z","message":"[controls]
fix Korean characters split into 2 characters with space in between when
typing in options list search input (#213164)\n\nCloses
https://github.com/elastic/kibana/issues/213150\n\nTest steps\n* Follow
https://www.youtube.com/watch?v=vjulSf3Kwu4 to setup duel\nlanguage
inputs with English and Korean.\n* Create a dashboard with an options
list. Switch to Korean input and\ntype in option list control. Type the
characters `d` and `k` on an\nenglish keyboard.\n* Ensure input treats
value as a single character.\n<img width=\"591\" alt=\"Screenshot
2025-03-04 at 1 52
14 PM\"\nsrc=\"https://github.com/user-attachments/assets/c7cfe0f5-156d-4949-932a-96067bf20fd6\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3ce9019ce3260d9155827edd97bb80dea439bc5a","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.19.0","v8.16.6","v8.17.4"],"title":"[controls]
fix Korean characters split into 2 characters with space in between when
typing in options list search
input","number":213164,"url":"https://github.com/elastic/kibana/pull/213164","mergeCommit":{"message":"[controls]
fix Korean characters split into 2 characters with space in between when
typing in options list search input (#213164)\n\nCloses
https://github.com/elastic/kibana/issues/213150\n\nTest steps\n* Follow
https://www.youtube.com/watch?v=vjulSf3Kwu4 to setup duel\nlanguage
inputs with English and Korean.\n* Create a dashboard with an options
list. Switch to Korean input and\ntype in option list control. Type the
characters `d` and `k` on an\nenglish keyboard.\n* Ensure input treats
value as a single character.\n<img width=\"591\" alt=\"Screenshot
2025-03-04 at 1 52
14 PM\"\nsrc=\"https://github.com/user-attachments/assets/c7cfe0f5-156d-4949-932a-96067bf20fd6\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3ce9019ce3260d9155827edd97bb80dea439bc5a"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x","8.16","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213164","number":213164,"mergeCommit":{"message":"[controls]
fix Korean characters split into 2 characters with space in between when
typing in options list search input (#213164)\n\nCloses
https://github.com/elastic/kibana/issues/213150\n\nTest steps\n* Follow
https://www.youtube.com/watch?v=vjulSf3Kwu4 to setup duel\nlanguage
inputs with English and Korean.\n* Create a dashboard with an options
list. Switch to Korean input and\ntype in option list control. Type the
characters `d` and `k` on an\nenglish keyboard.\n* Ensure input treats
value as a single character.\n<img width=\"591\" alt=\"Screenshot
2025-03-04 at 1 52
14 PM\"\nsrc=\"https://github.com/user-attachments/assets/c7cfe0f5-156d-4949-932a-96067bf20fd6\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3ce9019ce3260d9155827edd97bb80dea439bc5a"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
  • Loading branch information
kibanamachine and nreese authored Mar 5, 2025
1 parent 543bf80 commit 07d9083
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export const useBatchedOptionalPublishingSubjects = <
* Batches the latest values of multiple publishing subjects into a single object. Use this to avoid unnecessary re-renders.
* Use when `subjects` are static and do not change over the lifetime of the component.
*
* Do not use when value is used as an input value to avoid debouncing user interactions
*
* @param subjects Publishing subjects array.
*/
export const useBatchedPublishingSubjects = <
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import {
EuiText,
EuiToolTip,
} from '@elastic/eui';
import { useBatchedPublishingSubjects } from '@kbn/presentation-publishing';
import {
useBatchedPublishingSubjects,
useStateFromPublishingSubject,
} from '@kbn/presentation-publishing';

import { getCompatibleSearchTechniques } from '../../../../../common/options_list/suggestions_searching';
import { useOptionsListContext } from '../options_list_context_provider';
Expand All @@ -36,16 +39,18 @@ export const OptionsListPopoverActionBar = ({
}: OptionsListPopoverProps) => {
const { api, stateManager, displaySettings } = useOptionsListContext();

// Using useStateFromPublishingSubject instead of useBatchedPublishingSubjects
// to avoid debouncing input value
const searchString = useStateFromPublishingSubject(stateManager.searchString);

const [
searchString,
searchTechnique,
searchStringValid,
invalidSelections,
totalCardinality,
field,
allowExpensiveQueries,
] = useBatchedPublishingSubjects(
stateManager.searchString,
stateManager.searchTechnique,
stateManager.searchStringValid,
api.invalidSelections$,
Expand Down

0 comments on commit 07d9083

Please sign in to comment.