eclipsesource / eclipsesource/jsonforms

Material labels use too much vertical space when containing certain characters

Open
#1,605 2 comments 0 reactions 1 assignee Claimed by @TheZoker View on GitHub
bug material react
Dominant language
TypeScript
Stars
2.7k
Forks
424
Avg merge
17d 8h
Merged PRs (30d)
1

Description

**Describe the bug**
If material react labels contain certain characters (e.g. `.` or `-` and possibly more), they grab too much vertical space. It seems like the additional space grabbed is the same as if the label were wrapped once due to insufficient horizontal space (see screenshots below).

**To Reproduce**
Steps to reproduce the behavior:
1. Have a UISchema with three (or more) horizontal layouts below each other (e.g. in a vertical layout)
2. Have a row which only contains labels without special characters
3. Have another row with at least one label containing special characters
4. The row with the special character is too high even if there is sufficient horizontal space.

**Expected behavior**
The labels with special characters don't use excessive space if there is enough horizontal space.

**Screenshots**
If applicable, add screenshots to help explain your problem.
![image](https://user-images.githubusercontent.com/6959840/86913980-c9ae1f00-c11f-11ea-9dcb-63286054841f.png)

Used ui schema:
```typescript
const UISCHEMA = {
type: 'VerticalLayout',
elements: [
{
type: 'HorizontalLayout',
elements: [
{
type: 'Label',
text: 'X',
},
{
type: 'Label',
text: 'Y',
},
{
type: 'Label',
text: 'ZZ',
},
],
},
{
type: 'HorizontalLayout',
elements: [
{
type: 'Label',
text: 'X',
},
{
type: 'Label',
text: 'Y',
},
{
type: 'Label',
text: 'ZZ',
},
],
},
{
type: 'HorizontalLayout',
elements: [
{
type: 'Label',
text: 'X',
},
{
type: 'Label',
text: 'Y',
},
{
type: 'Label',
text: 'Z-Z',
},
],
},
{
type: 'HorizontalLayout',
elements: [
{
type: 'Label',
text: 'X',
},
{
type: 'Label',
text: 'Y',
},
{
type: 'Label',
text: 'ZZ',
},
],
},
],
};
```
**Browser (please complete the following information):**
Tested with Chrome and Firefox

**Used Setup (please complete the following information):**
- Framework: react
- RendererSet: material

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.