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

Add quasar's "row" class to ui.row #3008

Merged
merged 1 commit into from
May 6, 2024
Merged

Add quasar's "row" class to ui.row #3008

merged 1 commit into from
May 6, 2024

Conversation

falkoschindler
Copy link
Contributor

This PR tries to solve #2881 by adding Quasar's "row" class to ui.row. Since it only adds

.column, .flex, .row {
    display: flex;
    flex-wrap: wrap;
}

we only need to deal with the new wrap setting. Therefore I changed

if wrap:
    self._classes.append('wrap')

to

if not wrap:
    self._style['flex-wrap'] = 'nowrap'

This way wrap=False counteracts "row"s flex-wrap setting.

For consistency I changed the wrap handling for ui.column from

if wrap:
    self._classes.append('wrap')

to

if wrap:
    self._style['flex-wrap'] = 'wrap'

But since there are no row-* classes in Quasar for layouting columns, there is no need to add the "column" class to ui.column.

I tested the new behavior with the following demo:

with ui.row(wrap=False).classes('w-40 h-40 border'):
    ui.label('A').classes('border col-6')
    ui.label('B').classes('border col-6')

with ui.row(wrap=True).classes('w-40 h-40 border'):
    ui.label('A').classes('border col-6')
    ui.label('B').classes('border col-6')

with ui.column(wrap=False).classes('w-40 h-40 border'):
    ui.label('A').classes('border h-24')
    ui.label('B').classes('border h-24')

with ui.column(wrap=True).classes('w-40 h-40 border'):
    ui.label('A').classes('border h-24')
    ui.label('B').classes('border h-24')

@falkoschindler falkoschindler added the enhancement New feature or request label May 3, 2024
@falkoschindler falkoschindler added this to the 1.4.24 milestone May 3, 2024
@falkoschindler falkoschindler linked an issue May 3, 2024 that may be closed by this pull request
@falkoschindler falkoschindler requested review from rodja and removed request for rodja May 6, 2024 08:24
@falkoschindler falkoschindler merged commit d6236c0 into main May 6, 2024
7 checks passed
@falkoschindler falkoschindler deleted the quasar-row branch May 6, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quasar CSS flexbox layout classes don't work
1 participant