Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simplify input groups by dropping.input-group-prepend and.input-group-append#29885

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

MartijnCuppens
Copy link
Member

@MartijnCuppensMartijnCuppens commentedDec 19, 2019
edited
Loading

_input-groups.scss has become quite hard to maintain, mainly because of the nesting we have with.input-group-prepend and.input-group-append. It's actually pretty simple to remove this. This will also make our html look a lot simpler.

Before:

<divclass="input-group mb-3"><divclass="input-group-prepend"><spanclass="input-group-text"id="basic-addon1">@</span></div><inputtype="text"class="form-control"placeholder="Username"aria-label="Username"aria-describedby="basic-addon1"></div>

After:

<divclass="input-group mb-3"><spanclass="input-group-text"id="basic-addon1">@</span><inputtype="text"class="form-control"placeholder="Username"aria-label="Username"aria-describedby="basic-addon1"></div>

Demo:https://deploy-preview-29885--twbs-bootstrap.netlify.com/docs/4.3/forms/input-group/

Alsocloses#30111,closes#30104
Seehttps://codepen.io/MartijnCuppens/pen/mdyZBoR

For the dropdown buttons some things needed to be changed in order to make this work because theshow class was added to the (random) parent of the toggle button instead to the button itself. The way the dropdown menu is found is now changed.

While I was working on this, I discovered a bug which is explained in#30117. Please review this first because that PR also includes a test.

I've also added an additional example to test multiple dropdowns in a input group:https://deploy-preview-29885--twbs-bootstrap.netlify.com/docs/4.3/forms/input-group/#buttons-with-dropdowns

To Do:

  • Change the way the dropdown menu is detected
  • Change the way active states are set to toggle buttons
  • Adjust existing tests

Glenn-Domin and jonathanhefner reacted with thumbs up emoji
@alecpl
Copy link
Contributor

alecpl commentedDec 20, 2019
edited
Loading

Very nice. Thank you.

@XhmikosR
Copy link
Member

Definitely like this, reduces the final CSS size too 🎉

Copy link
Contributor

@ysdsysds left a comment

Choose a reason for hiding this comment

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

Some use cases are no longer supported, are they intentional?

v4 supported use cases:#25352

@MartijnCuppens
Copy link
MemberAuthor

@ysds, what use cases exactly?

(I know theinput group↔️ validation message thing is still an issue, but this is not something new?)

@MartijnCuppens
Copy link
MemberAuthor

Ping@ysds

@XhmikosR
Copy link
Member

Just so we are safe, did you check the examples too@MartijnCuppens?

@MartijnCuppens
Copy link
MemberAuthor

@XhmikosR, no appearances ofinput-group-prepend orinput-group-append left. Only thebtn-groups are used in the examples.

XhmikosR reacted with thumbs up emoji

@ysds
Copy link
Contributor

@MartijnCuppens Please see dropdown menu's corner inthis netlify:

image

That should be rounded.

And cases that have multiple dropdown menus:

image

@MartijnCuppensMartijnCuppensforce-pushed themaster-mc-drop-input-group-prepend-appends branch fromff247c2 tocd0b3acCompareJanuary 31, 2020 10:19
@MartijnCuppens
Copy link
MemberAuthor

Just fixed that.

@ysds
Copy link
Contributor

The 2nd issue (multiple active states with multiple dropdowns) still seems to occur.

@MartijnCuppensMartijnCuppens requested a review froma team as acode ownerFebruary 1, 2020 13:56
@MartijnCuppensMartijnCuppensforce-pushed themaster-mc-drop-input-group-prepend-appends branch 4 times, most recently from8c82e88 to137a7fdCompareFebruary 1, 2020 18:10
@ysds
Copy link
Contributor

ysds commentedFeb 10, 2020
edited
Loading

The CSS side LGTM.@XhmikosR Could you see the JS side?

@MartijnCuppens
Copy link
MemberAuthor

Please reviewhttps://github.com/twbs/bootstrap/pull/30117/files first, it includes a fix and test for theprev() function.

@mdomdo added the js labelMar 7, 2020
@mdo
Copy link
Member

mdo commentedMar 7, 2020

Punted to Alpha 2 for now, but would happily see it back to first alpha if the JS errors get fixed.

@MartijnCuppensMartijnCuppensforce-pushed themaster-mc-drop-input-group-prepend-appends branch 2 times, most recently fromb64fd1e to02838f6CompareMarch 10, 2020 19:58
@MartijnCuppens
Copy link
MemberAuthor

This fails in IE because of the matches polyfill:

IE 11.0.0 (Windows 10.0.0) Dropdown data-api should fire hide and hidden event without a clickEvent if event type is not click FAILEDObject doesn't support property or method 'matches' thrownIE 11.0.0 (Windows 10.0.0) Dropdown data-api should fire hide and hidden event without a clickEvent if event type is not click FAILEDObject doesn't support property or method 'matches' thrown................................................IE 11.0.0 (Windows 10.0.0) Dropdown data-api should ignore keyboard events for <input>s and <textarea>s within dropdown-menu, except for escape key FAILEDObject doesn't support property or method 'matches' thrownError: Expected true to equal false.    at <Jasmine>   at Anonymous function (js/tests/unit/js/tests/unit/dropdown.spec.js:1495:9 <- js/tests/unit/dropdown.spec.js:15745:11)IE 11.0.0 (Windows 10.0.0) Dropdown data-api should ignore keyboard events for <input>s and <textarea>s within dropdown-menu, except for escape key FAILEDObject doesn't support property or method 'matches' thrownError: Expected true to equal false.    at <Jasmine>   at Anonymous function (js/tests/unit/js/tests/unit/dropdown.spec.js:1495:9 <- js/tests/unit/dropdown.spec.js:15745:11)

@XhmikosR
Copy link
Member

@MartijnCuppens you can use our helper, or wait until#30377 lands :)

@MartijnCuppens
Copy link
MemberAuthor

The helper is used I guess. I don't really understand the reason whynext() is failing andprev() is not

@Johann-S
Copy link
Member

the JS looks good to me, nice work@MartijnCuppens 👍

@MartijnCuppensMartijnCuppensforce-pushed themaster-mc-drop-input-group-prepend-appends branch from429c63a to267ae2aCompareMarch 23, 2020 13:50
@MartijnCuppensMartijnCuppensforce-pushed themaster-mc-drop-input-group-prepend-appends branch from267ae2a toeaeffa1CompareMarch 23, 2020 14:04
@MartijnCuppensMartijnCuppens merged commit2e150e7 intomasterMar 23, 2020
@MartijnCuppensMartijnCuppens deleted the master-mc-drop-input-group-prepend-appends branchMarch 23, 2020 14:35
@ysdsysds mentioned this pull requestMay 13, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@XhmikosRXhmikosRXhmikosR approved these changes

@Johann-SJohann-SJohann-S approved these changes

+1 more reviewer

@ysdsysdsysds left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

The style is not strict enough .input-group-prepend .btn+.btn

6 participants

@MartijnCuppens@alecpl@XhmikosR@ysds@mdo@Johann-S

[8]ページ先頭

©2009-2025 Movatter.jp