Comments (14)
Could you show the code used to invoke the prompt window?
from electron-prompt.
const ePrompt = require('electron-prompt');
ePrompt({
title: 'Enter the Terminal Profile Data',
label: 'data:',
value: ''
})
.then((r) => {
if(r !== null) {
//Send a message to decode the parameter
//win.openDevTools();
win.webContents.send('decode', {
data: r`
});
}
})
.catch(console.error);
from electron-prompt.
I remember this happening to me too. If you don't set the height, it defaults to 130, which is not enough even for this kind of simple input window on windows. My guess is that on OS X the font/input box/buttons/padding or whatnot is different size than on windows and everything fits snuggly.
Probably only way around this is to check which platform you are on and set height accordingly.
Maybe it wouldn't be too difficult to change the fixed default height to fit to content instead?
from electron-prompt.
I'd probably prefer a solution that would just set a window client size instead of trying to find the correct window size (including borders) on each platform.
from electron-prompt.
Yeah, that was my tired attempt to explain on the last line 😩 To set the window height automatically according to the content the default behaviour. I'll try to find time to play around with this in the next few days and see if it's easy to implement.
from electron-prompt.
Ok, it seems there's something weird going on with my win10 machine.
Running the latest electron quick start and electron-prompt 1.3.1.
If you leave the height out, prompt should default to 130, but it's around 80 pixels...
If you put the height to 330, it's only around 280...
So where's the missing 50 pixels:thinking:?
As a side note, I wrote this little function about a year ago for one of my apps to resize the electron window height to fit all the content in the window without scroll bars. Might be useful when thinking a solution for this issue.
from electron-prompt.
Found the missing pixels, culprit is the BrowserWindow option useContentSize , if set to false, I get the default 130 pixels for the height, but as you can see, it's not enough...
Either there's some weird conflict with the settings or this is a bug in electron?
Yea, related electron issue
from electron-prompt.
Ok, after reading the electron issue and testing, simply setting the 'resizable' to true solves this issue
So, I would propose that we change the resizable-option default to true, @p-sam ?
from electron-prompt.
Yeah, but as the option states, that would also make the window resizable, which is not desirable. You seem to want to set the width and height dynamically based on the content, and as I stated in my previous message, the ideal solution would be to set something commonly called as the "client size", which is the inner size of the window content (without chrome/border). I may look into this myself later, however I have other stuff on my TODO right now, sorry
from electron-prompt.
No worries, I was just curious about what caused this behaviour. Anyway, it's should be pretty easy for others to 'fix' this now if they bumb into this problem.
from electron-prompt.
Please check if everything is resolved on develop. The actual issue was that the minimum height changed for all platforms (and was wrong), however not all platforms would exhibit the same behavior with different values of resizable/useContentSize. I'll probably release a new version I have multiple confirmations that it works now. (Tested myself on Windows and OSX right now)
from electron-prompt.
Ok, glad to hear you found the actual problem. Comparing the master and developement branches, I see there is few new options and a lot of housecleaning done. Looks good to me for the next release 🚀
from electron-prompt.
alright, let's go then
from electron-prompt.
fixed in v1.4.0
from electron-prompt.
Related Issues (20)
- electron-prompt cannot be used if I compile a exe program
- Error: Image could not be created from \n HOT 2
- Suggestion : Allow 'minimizable' for BrowserWindow in opts HOT 1
- Include a LICENSE file at the root of the repo HOT 4
- Validate form on Enter/return key pressed HOT 5
- Feature Request: allow creating an inescapable prompt HOT 1
- If you're using this in electron-react-boilerplate...
- Prompt window closes immediately for some Linux users HOT 2
- Preview electron-prompt HOT 2
- Label and Input issue HOT 3
- ERR_FILE_NOT_FOUND (-6) loading HOT 1
- [feature request]Add a 'swapButtons' option
- Add typescript support? (`d.ts` file) HOT 2
- Use `@electron/remote` instead of importing it from `electron` as it will be deprecated in Electron version 14 HOT 5
- testing example prompt: label and input field not displayed, cancel and ok buttons unstyled HOT 2
- Issue with promise HOT 1
- Add support for MacBook's touchbar
- Using a single JS file to do the prompt
- Can't make it work with Electron 19
- [feature request] Multi prompt for example having 2 or 3... input forms
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-prompt.