Results 1 to 5 of 5

Thread: MessageBox doesn't resize every time based on message content

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-427 in a recent build.
  1. #1

    Default MessageBox doesn't resize every time based on message content

    Sencha Touch version tested:
    • 1.1.0

    • only default ext-all.css
    • custom css (include details)


    Platform tested against:
    • iOS 3.x
    • iOS 4
    • Android 2.1
    • Android 2.2
    • Windows Desktop Chrome
    • Windows Desktop Safari
    Description:
    • MessageBox size is not getting resized every time we pass message content with different length.
    Test Case:

    Code:
        Ext.Msg.alert('Hi', "First Message");
        //do something
        Ext.Msg.alert('Hi', "Second Message is more lengthier than the first one. This message will not be displayed properly");
    Steps to reproduce the problem:
    • Create a message box with short message and show it. This message box will display properly
    • Show another message box with lengthy message.
    The result that was expected:
    • Second message box and all the following message box should resize based on the new content.
    The result that occurs instead:
    • Second message box is not resized for the new lengthy message content and you won't be able to see all the words clearly.
    Screenshot or Video:
    • attached
    Debugging already done:
    • None
    Possible fix:
    • Right now I'm handling by destroying the message box instance every time I finish showing up the content.

  2. #2
    Sencha User
    Join Date
    May 2011
    Posts
    8

    Default

    I've worked around this by doing doComponentLayout() on Message Boxes

  3. #3
    Sencha User
    Join Date
    Jul 2010
    Location
    Switzerland
    Posts
    78

    Default

    Code:
    Ext.Msg.on('show', function () {
        Ext.Msg.doComponentLayout();
    });
    is how I handle this issue for now

  4. #4
    Sencha - Engineering Operations mike.estes's Avatar
    Join Date
    Mar 2011
    Location
    Redwood City, CA
    Posts
    221

    Default

    Thanks for the report, filed as TOUCH-427. Listening for the show event and calling doComponentLayout is indeed the best workaround for now.

  5. #5
    Touch Premium Member
    Join Date
    Jul 2010
    Posts
    2

    Default

    You can also overwrite the show method of Ext.Msg and just add a this.doComponentLayout() at the bottom. So like:

    Code:
        Ext.override(Ext.MessageBox, {
            show : function(config) {
                var attrib,
    ...
                if (config.input) {
                    config.input.dom.value = config.value || '';
                    // For browsers without 'autofocus' attribute support
                    if (assert.test(attribs.autofocus+'') && !('autofocus' in config.input.dom)) {
                        config.input.dom.focus();
                    }
                }
                
                this.doComponentLayout();
    
    
                return this;
            }

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •