Get max of a reactive dataframe

I have a reactive data frame called df() which filters data using dplyr and filters are tied to user input. Further down I have a observeEvent which observes some inputs and checks if they are less than the max of column named "error" in df() then it throws an alert to the user in shiny UI.

I noticed that when I do max(df()$error) the value is the maximum value of the unfiltered original data frame and not the reactive one. How can I get the maximum to change according to the reactive df()?


To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one: