Git Product home page Git Product logo

Comments (14)

p-sam avatar p-sam commented on July 2, 2024

Could you show the code used to invoke the prompt window?

from electron-prompt.

jbdamiano avatar jbdamiano commented on July 2, 2024
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.

Fraasi avatar Fraasi commented on July 2, 2024

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.

p-sam avatar p-sam commented on July 2, 2024

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.

Fraasi avatar Fraasi commented on July 2, 2024

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.

Fraasi avatar Fraasi commented on July 2, 2024

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...

pic2

If you put the height to 330, it's only around 280...

pic1

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.

Fraasi avatar Fraasi commented on July 2, 2024

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...

pic3

Either there's some weird conflict with the settings or this is a bug in electron?
Yea, related electron issue

from electron-prompt.

Fraasi avatar Fraasi commented on July 2, 2024

Ok, after reading the electron issue and testing, simply setting the 'resizable' to true solves this issue

pic4

So, I would propose that we change the resizable-option default to true, @p-sam ?

from electron-prompt.

p-sam avatar p-sam commented on July 2, 2024

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.

Fraasi avatar Fraasi commented on July 2, 2024

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.

p-sam avatar p-sam commented on July 2, 2024

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.

Fraasi avatar Fraasi commented on July 2, 2024

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.

p-sam avatar p-sam commented on July 2, 2024

alright, let's go then

from electron-prompt.

p-sam avatar p-sam commented on July 2, 2024

fixed in v1.4.0

from electron-prompt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.