-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Accept data-bs-body option in the configuration object as well #33248
Conversation
a181c28
to
e6ecb3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left few comments, except them LGTM 👍
@@ -153,6 +153,14 @@ const isVisible = element => { | |||
return false | |||
} | |||
|
|||
const isDisabled = element => { | |||
if (!element) { | |||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd return false here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure. In code if an element not exists, you don't want to count it as valid. right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the check is for isDisabled
. If the element doesn't exist then it can't be disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually we check if a button/anchor/input (or another div) is disabled. Almost in any case it will not be null. The null check is for the 'just in case' situation
I can omitted if you find it more accurate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer being stricter :) That being said, the logic seems off to me for the aforementioned reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another proposal is to throw an exception on line 157.
No-one has checked all these before, so if there is any other opinion I would like to know in order to finalize this
@twbs/js-review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, if the DOM element does not exist it should not be considered as enabled. The absence of the DOM element is also like the disability 🤔
140cd7f
to
663e16d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
9c4035b
to
bbb8b2f
Compare
bbb8b2f
to
9ef3d25
Compare
65a810a
to
475b920
Compare
Tweak jqueryInterface, add some more tests
475b920
to
1b35d63
Compare
Refactor offcanvas to accept config.
In order to use a simple configuration I separated
bs-body
option tobs-scroll
andbs-backdrop
Preview