-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix(enhancers): Made enhancers position dependent on where you click enhancers from, if mobile, setting floating to true. hide scrollbars in chrome #286
Conversation
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.
Looks snazzy, code works!
/* Prevent toggle twice when toggle enhancer button is clicked (for mobile case ) */ | ||
const chatToggleEnhancer = document.getElementById('chat-enhancer-toggle') | ||
// @ts-ignore | ||
// // @ts-ignore |
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.
Can we just delete this and the this.click above?
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.
If possible on this, we should use refs, using document selectors is an antipattern in vue.
/* Prevent toggle twice when toggle enhancer button is clicked (for mobile case ) */ | ||
const chatToggleEnhancer = document.getElementById('chat-enhancer-toggle') | ||
// @ts-ignore | ||
// // @ts-ignore |
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.
If possible on this, we should use refs, using document selectors is an antipattern in vue.
@@ -26,6 +26,10 @@ const InitalUIState = (): UIState => ({ | |||
enhancers: { | |||
show: false, | |||
floating: false, | |||
position: [0, 0], | |||
defaultWidth: '24rem', | |||
defaultHeight: '30rem', |
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 don't love storing these values in state, can we use global less vars here? Do these need to be dynamic? IF so can we use less selectors for it?
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.
We moved these to state because we need them in the style and for a calculation to detect if the enhancers component would be off screen
4b16666
to
97ab546
Compare
…from, if mobile, setting floating to true. hide scrollbars in chrome. #SA-187 and #AP-112.
97ab546
to
b20a33c
Compare
…from, if mobile, setting floating to true. hide scrollbars in chrome. #SA-187 and #AP-112. (#286)
What this PR does 📖
These changes make the enhancers menu show up close to where the user clicks the enhancer from on desktop. On mobile it defaults to a floating enhancer. This also removes the chrome scrollbar for the enhancer.
Which issue(s) this PR fixes 🔨
Fixes # SA-187
Special notes for reviewers 🗒️
Tested on desktop and through mobile view in chrome devtools. Reload in between aspect ratio/form factor changes. This is mostly taken from the @KemoPaw's recent PR
Additional comments 🎤