title: How do I make dynamically created inputs in R/Shiny flow like normal inputs in flowLayout?
body: <p>I have a mix of dynamically created inputs and normally defined inputs.  The dynamically created inputs behave like a large vertically stacked block that the other inputs flow around.  How do I make them all flow together?  </p>
  
  <p>This reproduces the issue:</p>
  
  <pre><code>library(shinydashboard)
  shinyApp(
    ui = dashboardPage(
      dashboardHeader(),
      dashboardSidebar(),
      dashboardBody(
        flowLayout(
          uiOutput('input_fields'),
          textInput('fielda','Field A',''),
          textInput('fieldb','Field B',''),
          textInput('fieldc','Field C',''),
          textInput('fieldd','Field D','')
        )
      )
    ),
    server = function(input, output) {
      output$input_fields &lt;- renderUI({
        lapply(1:4, function(i) {
          textInput(paste0('field',i), paste('Field',i),'')
        })
      })
    }
  )
  </code></pre>
  
  <p>Current layout:</p>
  
  <p><a href="https://i.stack.imgur.com/zYsqu.png" rel="nofollow"><img src="https://i.stack.imgur.com/zYsqu.png" alt=""></a></p>
  
  <p>Desired layout: </p>
  
  <p><a href="https://i.stack.imgur.com/Ghcti.png" rel="nofollow"><img src="https://i.stack.imgur.com/Ghcti.png" alt=""></a></p>
  
  <p>Edit:  Ignore the Field A,B,C,D widgets.  They are just for showing how other items wrap but the uiOutput ones act as one block.  Assume all inputs are dynamic.  </p>
  
  <p>I think I'm to use this code instead.  It moves the renderUI inside the lapply to create multiple generic outputs (varies at runtime, up to 10) which I can reference with equally generic uiOutput statements.  It doesn't even warn about the 5 outputs that don't exist.  Not perfect but it'll do. Probably need to add in an observeEvent as I don't think it will be reactive on its own.</p>
  
  <pre><code>library(shinydashboard)
  shinyApp(
    ui = dashboardPage(
      dashboardHeader(),
      dashboardSidebar(),
      dashboardBody(
        wellPanel(
          flowLayout(
            uiOutput('field1'),
            uiOutput('field2'),
            uiOutput('field3'),
            uiOutput('field4'),
            uiOutput('field5'),
            uiOutput('field6'),
            uiOutput('field7'),
            uiOutput('field8'),
            uiOutput('field9'),
            uiOutput('field10')
          )
        )
      )
    ),
    server = function(input, output) {
      lapply(1:5, function(i) {
        output[[paste0('field',i)]] &lt;- renderUI({
          textInput(paste0('field',i), paste('Field',i),'')
        })
      })
    }
  )
  </code></pre>