[v12.0/forgejo] fix: wrap items in gitignore dropdown (#8841)

**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8830

- Resolves forgejo/forgejo#2639
- Simple E2E test to show it doesn't overflow

Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8841
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
forgejo-backport-action 2025-08-09 20:20:40 +02:00 committed by Gusted
commit 978ff860e6
2 changed files with 22 additions and 1 deletions

View file

@ -7,7 +7,7 @@
<div class="hide-unless-checked"> <div class="hide-unless-checked">
<label> <label>
.gitignore .gitignore
<div class="ui multiple search selection dropdown"> <div class="ui multiple search selection dropdown tw-flex-wrap">
<input type="hidden" name="gitignores" value="{{.gitignores}}"> <input type="hidden" name="gitignores" value="{{.gitignores}}">
<div class="default text">{{ctx.Locale.Tr "repo.repo_gitignore_helper"}}</div> <div class="default text">{{ctx.Locale.Tr "repo.repo_gitignore_helper"}}</div>
<div class="menu"> <div class="menu">

View file

@ -125,3 +125,24 @@ test('New repo: label set', async ({page}) => {
await expect(page.getByText('Kind/Bug Something is not')).toBeVisible(); await expect(page.getByText('Kind/Bug Something is not')).toBeVisible();
await save_visual(page); await save_visual(page);
}); });
test('New repo: gitignore', async ({page}) => {
await page.goto('/repo/create');
await page.getByText('Start the Git history with').click();
const gitignoreDropdown = page.locator('.hide-unless-checked label:first-of-type > div');
await gitignoreDropdown.click();
await page.getByRole('option', {name: 'ArchLinuxPackages'}).click();
await page.getByRole('option', {name: 'Android'}).click();
await page.getByRole('option', {name: 'ChefCookbook'}).click();
await page.getByRole('option', {name: 'GNOMEShellExtension'}).click();
await page.getByRole('option', {name: 'JupyterNotebooks'}).click();
await page.getByRole('option', {name: 'NotesAndExtendedConfiguration'}).click();
await page.getByRole('option', {name: 'MetaProgrammingSystem'}).click();
await page.getByRole('option', {name: 'AppceleratorTitanium'}).click();
await save_visual(page);
const segmentWidth = (await page.locator('.segment').boundingBox()).width;
const dropdownWidth = (await gitignoreDropdown.boundingBox()).width;
expect(dropdownWidth).toBeLessThan(segmentWidth);
});