-
Notifications
You must be signed in to change notification settings - Fork 94
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
Feature: Add Expanding Query Input Field #1020
Merged
thewahome
merged 6 commits into
microsoftgraph:dev
from
LokiLabs:interns/AyuAi/query-word-wrap
Aug 3, 2021
Merged
Feature: Add Expanding Query Input Field #1020
thewahome
merged 6 commits into
microsoftgraph:dev
from
LokiLabs:interns/AyuAi/query-word-wrap
Aug 3, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ayubun
requested review from
adhiambovivian,
ddyett,
ElinorW,
millicentachieng and
thewahome
as code owners
July 13, 2021 16:55
ayubun
force-pushed
the
interns/AyuAi/query-word-wrap
branch
from
July 13, 2021 23:56
fab527b
to
c4ade2c
Compare
ayubun
changed the title
Expanding Query Input Field
Feature: Add Expanding Query Input Field
Aug 3, 2021
thewahome
reviewed
Aug 3, 2021
thewahome
reviewed
Aug 3, 2021
src/app/views/query-runner/query-input/auto-complete/AutoComplete.tsx
Outdated
Show resolved
Hide resolved
thewahome
reviewed
Aug 3, 2021
Comment on lines
63
to
82
public isOverflowing = (input: string) => { | ||
|
||
function getTextWidth(text: string) { | ||
const canvas = document.createElement('canvas'); | ||
const context = canvas.getContext('2d'); | ||
|
||
if (context === null) { | ||
return 0; | ||
} | ||
|
||
context.font = getComputedStyle(document.body).font; | ||
return context.measureText(text).width + 5; | ||
|
||
} | ||
|
||
return !!this.element | ||
&& getTextWidth(input) > this.element.scrollWidth; | ||
|
||
} | ||
|
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.
This is super COOL!
thewahome
reviewed
Aug 3, 2021
…icrosoft-graph-explorer-v4 into interns/AyuAi/query-word-wrap
ayubun
commented
Aug 3, 2021
src/app/views/query-runner/query-input/auto-complete/AutoComplete.tsx
Outdated
Show resolved
Hide resolved
thewahome
approved these changes
Aug 3, 2021
thewahome
added a commit
that referenced
this pull request
Aug 3, 2021
* Task: Add chat-id & membership-id (#1024) * Fix: query link parsing with trailing '.' (#1033) * Feature: DetailsList scrollbars only appear onHover (#1023) * Feature: automatic dark light mode (#1019) * Task: add translated aria labels (#1040) * Task: remove sandbox api test (#1042) * Fix: change hover scroll behaviour (#1043) * Fix: Accessibility bugs - Aug (#1041) * Feature: Add Expanding Query Input Field (#1020)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is intended to allow the query input field to wrap / expand when necessary to create more visibility when using long queries. Fixes #613
Feature Preview:
3140de7358e3a3c43e828f25489f4579.mp4
Notably, this PR is a bit hacky, as I didn't know a few things. If I could receive input on the following, it would help the PR significantly, I think:
multiline
autoAdjustHeight
FluentUITextField
; As far as I could tell, autoAdjustHeight
forces the minimum height to60px
and I don't know where to modify that. It could very well be impossible.TextField
to anautoAdjustHeight
TextField
when the text began to overflow, in order to keep the one-line aesthetic of the query input field. However, this switching functionality causes theTextField
to snap from one line to60px
(autoAdjustHeight
multiline
default) when converting between the two.FluentUI
?AD#38277