-
-
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
v4 - Add methods for determining if elements are shown, visible, expanded #21085
Conversation
Unsure how much feedback I can give you on this one :). I'm in favor of the added methods to help folks build a bit easier though. This also probably doesn't need to be done immediately for v4 and could be punted to v4.1 to help prioritize things. |
Yeah sure I agree plus it's a big change. My concerne is about the way I chose to do this |
this.each(function () { | ||
let data = $(this).data(DATA_KEY) | ||
if (!data) { | ||
let _config = typeof config === 'object' ? config : null |
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.
'_config' is never reassigned. Use 'const' instead prefer-const
this._isTransitioning = false | ||
|
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.
Trailing spaces not allowed no-trailing-spaces
@@ -342,7 +350,10 @@ const Tooltip = (($) => { | |||
|
|||
this.element.removeAttribute('aria-describedby') | |||
$(this.element).trigger(this.constructor.Event.HIDDEN) | |||
|
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.
Trailing spaces not allowed no-trailing-spaces
I have another solution we limit if (config === 'isShown' && this.length > 0) {
if (this.length > 1) {
throw new Error('isShown can be used only for one tooltip')
}
let data = $(this).data(DATA_KEY)
if (!data) {
const _config = typeof config === 'object' ? config : null
data = new Tooltip(this, _config)
$(this).data(DATA_KEY, data)
}
return data[config]()
} |
I close this PR, for now it's to early to work on that feature since we use jQuery |
I made this PR for this feature request in #17021 :
They are a lots of work to do but if I can have some feedbacks from maybe @fat, @bardiharborow and @mdo It would be great 😄 because I'm not sure if I chose the best way to do this