Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(slider): numbers remain on one line for locales with space group separators #7472

Merged
merged 10 commits into from
Aug 8, 2023

Conversation

benelan
Copy link
Member

@benelan benelan commented Aug 7, 2023

Related Issue: #7151

Summary

Numbers with a space group separator are breaking onto multiple lines. This replaces the space with a non-breaking space (nbsp) HTML entity.

ref: https://en.wikipedia.org/wiki/Non-breaking_space

@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Aug 7, 2023
@benelan benelan marked this pull request as ready for review August 7, 2023 18:59
@benelan benelan requested a review from a team as a code owner August 7, 2023 18:59
// change whitespace group characters that don't render correctly
this._group = this._actualGroup.trim().length === 0 ? " " : this._actualGroup;
// change whitespace group characters that don't render correctly to a unicode no-break space
this._group = this._actualGroup.trim().length === 0 || this._actualGroup == "\u0020" ? "\u00A0" : this._actualGroup;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be prettier to use html entities here instead of unicode. What do you think?

this._actualGroup === " " ? " " : this._actualGroup;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree that's nicer for the nbsp, but I like being very explicit about what is in " ", since there are a ton of white space characters that could have been copy/pasted in there. And then I didn't want to mix and match unicode and HTML entities. But I don't feel strongly about it if you'd like me to switch. Also story incoming

Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ Beautiful ✨ 👍

@benelan benelan added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Aug 8, 2023
@benelan benelan added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Aug 8, 2023
@benelan benelan merged commit 2747b22 into main Aug 8, 2023
@benelan benelan deleted the benelan/7151-group-sep-non-breaking branch August 8, 2023 01:48
@github-actions github-actions bot added this to the 2023 August Priorities milestone Aug 8, 2023
benelan pushed a commit that referenced this pull request Aug 8, 2023
🤖 I have created a release *beep* *boop*
---


<details><summary>@esri/calcite-components: 1.5.1</summary>

##
[1.5.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected])
(2023-08-08)


### Bug Fixes

* **accordion:** Restore accordion-items working with accordion across
shadow DOM
([#7466](#7466))
([bedb5db](bedb5db))
* **action-bar, action-pad:** Add native tooltip to expand action
([#7452](#7452))
([9673ef7](9673ef7))
* Fix SSR build error caused by browser-sniffing util
([#7461](#7461))
([e5381fa](e5381fa))
* **flow-item:** Use a native tooltip for the back button
([#7442](#7442))
([f38167b](f38167b))
* **input:** Fix clearable from throwing an error when value is
undefined
([#7476](#7476))
([633c2cd](633c2cd))
* **list:** Add missing drag handle locale strings
([#7462](#7462))
([2b5463e](2b5463e))
* **panel:** Add native tooltip to close button.
([#7434](#7434))
([70b45cf](70b45cf))
* **panel:** Allow panel content to take full height.
([#7454](#7454))
([b6bf54f](b6bf54f))
* **panel:** Correct header and action-bar z-indexing display issues
([#7440](#7440))
([db7eac7](db7eac7))
* **slider:** Numbers remain on one line for locales with space group
separators
([#7472](#7472))
([2747b22](2747b22))
</details>

<details><summary>@esri/calcite-components-react: 1.5.1</summary>

##
[1.5.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected])
(2023-08-08)


### Miscellaneous Chores

* **@esri/calcite-components-react:** Synchronize undefined versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @esri/calcite-components bumped from ^1.5.1-next.4 to ^1.5.1
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants