-
Notifications
You must be signed in to change notification settings - Fork 33
Bug: fix play with menu vis bug #448
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is duplicated in #447 , please remove from this PR for clarity. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // Minimal localStorage polyfill for Node environments where `localStorage` | ||
| // exists but does not implement the standard Storage interface (e.g. Node 25). | ||
| // This is only used during code generation (buf/protoc-gen-es) and keeps | ||
| // everything in-memory for the lifetime of the process. | ||
|
|
||
| (() => { | ||
| try { | ||
| const ls = globalThis.localStorage; | ||
| if (ls && typeof ls.getItem === 'function') { | ||
| // A compatible implementation already exists; do nothing. | ||
| return; | ||
| } | ||
| } catch { | ||
| // Accessing localStorage might throw in some environments; fall through to polyfill. | ||
| } | ||
|
|
||
| const store = new Map(); | ||
|
|
||
| const localStoragePolyfill = { | ||
| getItem(key) { | ||
| const value = store.get(String(key)); | ||
| return value === undefined ? null : value; | ||
| }, | ||
| setItem(key, value) { | ||
| store.set(String(key), String(value)); | ||
| }, | ||
| removeItem(key) { | ||
| store.delete(String(key)); | ||
| }, | ||
| clear() { | ||
| store.clear(); | ||
| }, | ||
| key(index) { | ||
| const keys = Array.from(store.keys()); | ||
| return index >= 0 && index < keys.length ? keys[index] : null; | ||
| }, | ||
| get length() { | ||
| return store.size; | ||
| }, | ||
| }; | ||
|
|
||
| Object.defineProperty(globalThis, 'localStorage', { | ||
| value: localStoragePolyfill, | ||
| configurable: true, | ||
| enumerable: false, | ||
| writable: true, | ||
| }); | ||
| })(); | ||
|
|
||
|
|
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is duplicated in #447 , please remove from this PR for clarity. |
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is duplicated in #447 , please remove from this PR for clarity. |
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.
These classes are necessary for the popover to correctly render on mobile. Can we look into a different solution here?
It would be helpful to have a description of the root cause for this visual bug.